From 4f97f4f59172c8d295a22f10204cdef507e3402a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 17 Jul 2016 21:27:12 +0200 Subject: [PATCH] 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. --- Makefile.real | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) -- 2.39.5