summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-08-02 23:01:06 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-08-02 23:01:06 (EDT)
commitf28a932ba5753dc17888edff40652cccce8b60b7 (patch)
tree1c93656070cdd34ce8c955c455894b25f9825ee6
parent1a080c1eb510528357df1ab78bef93a20e858906 (diff)
Pass macros like DESTDIR without using a file.
-rw-r--r--Makefile.in50
1 files changed, 26 insertions, 24 deletions
diff --git a/Makefile.in b/Makefile.in
index c0682c6..6ef9708 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -27,10 +27,20 @@ libdir = @libdir@
datadir = @datadir@
mandir = @mandir@
+DESTDIR = /
+
sh = @sh@
INSTALL = @install@
+MACROS = \
+ 'DESTDIR=$(DESTDIR)' \
+ 'prefix=$(prefix)' \
+ 'bindir=$(bindir)' \
+ 'libdir=$(libdir)' \
+ 'datadir=$(datadir)' \
+ 'mandir=$(mandir)'
+
distdir = $(package_name)-$(package_version)
distfiles = configure Makefile.in COPYING README INSTALL ChangeLog TODO \
genopkg.sh
@@ -39,51 +49,43 @@ distfiles = configure Makefile.in COPYING README INSTALL ChangeLog TODO \
all:
@printf 'Making executable files...\n'
- @cd src && $(MAKE) all
+ @cd src && $(MAKE) $(MACROS) all
@printf 'Making library files...\n'
- @cd lib && $(MAKE) all
+ @cd lib && $(MAKE) $(MACROS) all
@printf 'Making locales...\n'
- @cd locale && $(MAKE) all
+ @cd locale && $(MAKE) $(MACROS) all
@printf 'Making manual pages...\n'
- @cd man && $(MAKE) all
+ @cd man && $(MAKE) $(MACROS) all
clean:
@printf 'Cleaning executable files...\n'
- @cd src && $(MAKE) clean
+ @cd src && $(MAKE) $(MACROS) clean
@printf 'Cleaning library files...\n'
- @cd lib && $(MAKE) clean
+ @cd lib && $(MAKE) $(MACROS) clean
@printf 'Cleaning locales...\n'
- @cd locale && $(MAKE) clean
+ @cd locale && $(MAKE) $(MACROS) clean
@printf 'Cleaning manual pages...\n'
- @cd man && $(MAKE) clean
+ @cd man && $(MAKE) $(MACROS) clean
install: all
- @printf 'Generating installation configuration...\n'
- @if [ -n '$(DESTDIR)' ]; then \
- destdir='$(DESTDIR)'; \
- else \
- destdir=/; \
- fi; \
- mkdir -p "$${destdir}"; \
- echo "DESTDIR=$$(cd "$${destdir}" && pwd)" > install.config
@printf 'Installing executable files...\n'
- @cd src && $(MAKE) $$(cat ../install.config) install
+ @cd src && $(MAKE) $(MACROS) install
@printf 'Installing libary files...\n'
- @cd lib && $(MAKE) $$(cat ../install.config) install
+ @cd lib && $(MAKE) $(MACROS) install
@printf 'Installing locales...\n'
- @cd locale && $(MAKE) $$(cat ../install.config) install
+ @cd locale && $(MAKE) $(MACROS) install
@printf 'Installing manual pages...\n'
- @cd man && $(MAKE) $$(cat ../install.config) install
+ @cd man && $(MAKE) $(MACROS) install
uninstall:
@printf 'Uninstalling executable files...\n'
- @cd src && $(MAKE) $$(cat ../install.config) uninstall
+ @cd src && $(MAKE) $(MACROS) uninstall
@printf 'Uninstalling library files...\n'
- @cd lib && $(MAKE) $$(cat ../install.config) uninstall
+ @cd lib && $(MAKE) $(MACROS) uninstall
@printf 'Uninstalling locales...\n'
- @cd locale && $(MAKE) $$(cat ../install.config) uninstall
+ @cd locale && $(MAKE) $(MACROS) uninstall
@printf 'Uninstalling manual pages...\n'
- @cd man && $(MAKE) $$(cat ../install.config) uninstall
+ @cd man && $(MAKE) $(MACROS) uninstall
$(distdir):
@mkdir -p '$(distdir)'