From d31b721e987fe7d53cef087ed2f002b65a6a759e Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 21 Jan 2012 11:42:42 -0500 Subject: Modify build system for "compilation" and libs. --- diff --git a/INSTALL b/INSTALL index 3dc4618..4aaccd0 100644 --- a/INSTALL +++ b/INSTALL @@ -12,8 +12,7 @@ generates a 'Makefile' in your current working directory. The simplest way to configure, build, and install this package is: 1. Run the 'configure' script from the source directory or any other directory. For example, from the source directory you can run './configure'. - 2. Run 'make' to build the package. (Currently this does nothing, but this may - change in the future.) + 2. Run 'make' to build the package. 3. Run 'make install' to install the package. You will probably need superuser privileges to install files into your system. diff --git a/Makefile.in b/Makefile.in index f91e7ea..a2a88bd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,38 +18,64 @@ # along with this program. If not, see . SHELL = @shell@ - INSTALL = @install@ SRCDIR = @srcdir@ PREFIX = @prefix@ BINDIR = @bindir@ +LIBDIR = @libdir@ MANDIR = @mandir@ +.SUFFIXES: + +OBJS = lib/controlfields src/opkbuild \ + src/oh-strip src/oh-installfiles src/oh-gencontrol src/oh-buildopk \ + .PHONY: all -all: +all: $(OBJS) + +src lib: + @printf ' Making directories...\n' + @mkdir src lib + +sedscript: + @printf ' Writing sed script...\n' + @echo 's&@@BINDIR@@&$(BINDIR)&' > sedscript + @echo 's&@@LIBDIR@@&$(LIBDIR)&' >> sedscript + +$(OBJS): src lib sedscript + @printf ' SED $@\n' + @sed -f sedscript $(SRCDIR)/$@ > $@ .PHONY: clean clean: + rm -Rf src lib sedscript .PHONY: install install: all @printf ' INSTALL src/opkbuild\n' - @$(INSTALL) -D "$(SRCDIR)/src/opkbuild" "$(DESTDIR)/$(BINDIR)/opkbuild" + @$(INSTALL) -D "src/opkbuild" "$(DESTDIR)/$(BINDIR)/opkbuild" @printf ' INSTALL src/oh-strip\n' - @$(INSTALL) -D "$(SRCDIR)/src/oh-strip" "$(DESTDIR)/$(BINDIR)/oh-strip" + @$(INSTALL) -D "src/oh-strip" "$(DESTDIR)/$(BINDIR)/oh-strip" @printf ' INSTALL src/oh-installfiles\n' - @$(INSTALL) -D "$(SRCDIR)/src/oh-installfiles" "$(DESTDIR)/$(BINDIR)/oh-installfiles" + @$(INSTALL) -D "src/oh-installfiles" "$(DESTDIR)/$(BINDIR)/oh-installfiles" @printf ' INSTALL src/oh-buildopk\n' - @$(INSTALL) -D "$(SRCDIR)/src/oh-buildopk" "$(DESTDIR)/$(BINDIR)/oh-buildopk" + @$(INSTALL) -D "src/oh-buildopk" "$(DESTDIR)/$(BINDIR)/oh-buildopk" + @printf ' INSTALL lib/controlfields\n' + @$(INSTALL) -D "lib/controlfields" \ + "$(DESTDIR)/$(LIBDIR)/opkhelper/controlfields" @printf ' INSTALL man/opkbuild.1\n' - @$(INSTALL) -D "$(SRCDIR)/man/opkbuild.1" "$(DESTDIR)/$(MANDIR)/man1/opkbuild.1" + @$(INSTALL) -D "$(SRCDIR)/man/opkbuild.1" \ + "$(DESTDIR)/$(MANDIR)/man1/opkbuild.1" @printf ' INSTALL man/oh-strip.1\n' - @$(INSTALL) -D "$(SRCDIR)/man/oh-strip.1" "$(DESTDIR)/$(MANDIR)/man1/oh-strip.1" + @$(INSTALL) -D "$(SRCDIR)/man/oh-strip.1" \ + "$(DESTDIR)/$(MANDIR)/man1/oh-strip.1" @printf ' INSTALL man/oh-installfiles.1\n' - @$(INSTALL) -D "$(SRCDIR)/man/oh-installfiles.1" "$(DESTDIR)/$(MANDIR)/man1/oh-installfiles.1" + @$(INSTALL) -D "$(SRCDIR)/man/oh-installfiles.1" \ + "$(DESTDIR)/$(MANDIR)/man1/oh-installfiles.1" @printf ' INSTALL man/oh-buildopk.1\n' - @$(INSTALL) -D "$(SRCDIR)/man/oh-buildopk.1" "$(DESTDIR)/$(MANDIR)/man1/oh-buildopk.1" + @$(INSTALL) -D "$(SRCDIR)/man/oh-buildopk.1" \ + "$(DESTDIR)/$(MANDIR)/man1/oh-buildopk.1" .PHONY: uninstall uninstall: diff --git a/configure b/configure index b726c23..69af311 100755 --- a/configure +++ b/configure @@ -46,6 +46,8 @@ Installation directories: default: /usr/local --bindir=BINDIR install scripts in BINDIR default: PREFIX/bin + --libdir=LIBDIR install library scripts in LIBDIR + default: PREFIX/lib --mandir=MANDIR install manual pages in MANDIR default: PREFIX/share/man EOF @@ -57,7 +59,7 @@ print_version() ${PACKAGE} ${VERSION} configure Not generated by GNU Autoconf -Copyright (C) 2012 Patrick "P. J." McDermott +Copyright (C) 2011-2012 Patrick "P. J." McDermott License: GNU GPL version 3 or later . This configure script is free software: you can redistribute and/or modify it. There is NO WARRANTY, to the extent permitted by law. @@ -65,7 +67,7 @@ EOF } opts=$(getopt -n "${0}" -o 'hVq' -l 'help,version,quiet' \ - -l 'srcdir:,prefix:,bindir:' -- "${@}") + -l 'srcdir:,prefix:,bindir:,libdir:,mandir:' -- "${@}") if [ ${?} -ne 0 ]; then print_usage "${0}" >&2 exit 1; @@ -98,6 +100,11 @@ while true; do BINDIR="\${PREFIX}/${2}" shift 2 ;; + --libdir) + # Leave PREFIX unexpanded for now, in case it isn't set yet. + LIBDIR="\${PREFIX}/${2}" + shift 2 + ;; --mandir) # Leave PREFIX unexpanded for now, in case it isn't set yet. MANDIR="\${PREFIX}/${2}" @@ -127,11 +134,15 @@ fi if [ -z "${BINDIR}" ]; then BINDIR=${PREFIX}/bin fi +if [ -z "${LIBDIR}" ]; then + LIBDIR=${PREFIX}/lib +fi if [ -z "${MANDIR}" ]; then MANDIR=${PREFIX}/man fi # Expand PREFIX if it's there. eval "BINDIR=${BINDIR}" +eval "LIBDIR=${LIBDIR}" eval "MANDIR=${MANDIR}" find_dependency() @@ -173,6 +184,7 @@ s&@install@&${INSTALL} -c& s&@srcdir@&${SRCDIR}& s&@prefix@&${PREFIX}& s&@bindir@&${BINDIR}& +s&@libdir@&${LIBDIR}& s&@mandir@&${MANDIR}&" # Replace configuration variables in Makefile.in -- cgit v0.9.1