From: Andre Noll Date: Sun, 17 Jul 2016 19:27:12 +0000 (+0200) Subject: build: Support $(DESTDIR). X-Git-Tag: v0.6.0~9^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=4f97f4f59172c8d295a22f10204cdef507e3402a build: Support $(DESTDIR). 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. --- diff --git a/Makefile.real b/Makefile.real index c4539860..4970696b 100644 --- a/Makefile.real +++ b/Makefile.real @@ -354,11 +354,11 @@ maintainer-clean: distclean $(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 \ - $(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)