]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
build: Support $(DESTDIR).
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 17 Jul 2016 19:27:12 +0000 (21:27 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 8 Jan 2017 12:58:54 +0000 (13:58 +0100)
The DESTDIR feature is orthogonal to the existing --prefix option
to configure, and the GNU make manual strongly recommends to support
the feature, so this patch implements it.

The feature works as follows. The content of the DESTDIR make variable
is prepended to each installed target file. It is not set at all in
the Makefile, so files are installed into their expected locations by
default. For example, with the patch applied, one may say

make DESTDIR=/tmp/stage install

to install in /tmp/stage/usr/local.

Other than that, specifying DESTDIR has no effect and the value is
not included in any file contents.

Makefile.real

index c4539860a36eb5004c2f471e5bbca0c76bed2674..4970696b67ec9b38a365aabb992e240b6ecce853 100644 (file)
@@ -354,11 +354,11 @@ maintainer-clean: distclean
        $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
 
 install: all man
        $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
 
 install: all man
-       $(MKDIR_P) $(bindir) $(mandir)
+       $(MKDIR_P) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
        $(INSTALL) -s --strip-program $(STRIP) -m 755 \
        $(INSTALL) -s --strip-program $(STRIP) -m 755 \
-               $(prefixed_executables) $(bindir)
-       $(INSTALL) -m 644 $(man_pages) $(mandir)
-       $(MKDIR_P) $(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain
+               $(prefixed_executables) $(DESTDIR)$(bindir)
+       $(INSTALL) -m 644 $(man_pages) $(DESTDIR)$(mandir)
+       $(MKDIR_P) $(DESTDIR)$(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain
 
 $(tarball):
        $(Q) rm -rf $(tarball) $(tarball_pfx)
 
 $(tarball):
        $(Q) rm -rf $(tarball) $(tarball_pfx)