From f28a932ba5753dc17888edff40652cccce8b60b7 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 02 Aug 2012 23:01:06 -0400 Subject: Pass macros like DESTDIR without using a file. --- 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)' -- cgit v0.9.1