diff src/Makefile.in.in @ 5512:4aa8ee813265

Add a DESTDIR variable to all Makefiles, defaulting to the empty string, and use it in install targets. See xemacs-patches message <BANLkTinRnwk9qsCfBj_xkcyf7H4sH9fn7A@mail.gmail.com>.
author Jerry James <james@xemacs.org>
date Wed, 25 May 2011 09:15:20 -0600
parents 1f0b15040456
children 1a507c4c6c42
line wrap: on
line diff
--- a/src/Makefile.in.in	Wed May 25 14:01:38 2011 +0200
+++ b/src/Makefile.in.in	Wed May 25 09:15:20 2011 -0600
@@ -37,6 +37,8 @@
 RECURSIVE_MAKE_ARGS=@RECURSIVE_MAKE_ARGS@
 #endif
 
+DESTDIR=
+
 PROGNAME=@PROGNAME@
 prefix=@prefix@
 SRC=@srcdir@
@@ -1019,7 +1021,7 @@
 #ifdef HAVE_SHLIB
 MAKEPATH=../lib-src/make-path
 install: $(PROGNAME)
-	$(MAKEPATH) $(archlibdir)/include $(archlibdir)/include/m $(archlibdir)/include/s
+	$(MAKEPATH) $(DESTDIR)$(archlibdir)/include $(DESTDIR)$(archlibdir)/include/m $(DESTDIR)$(archlibdir)/include/s
 	-@echo "Copying include files for ellcc..."
 	-@hdir=`pwd`; \
 	cd $(SRC); hdrdir2=`pwd`; cd $$hdir; \
@@ -1033,12 +1035,12 @@
 		test -d s && hdrtars="$$hdrtars s/*"; \
 		test -d m && hdrtars="$$hdrtars m/*"; \
 		test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
-			(cd $(archlibdir)/include && umask 022 && tar xf -); \
-		chmod 755 $(archlibdir)/include; \
-		test -d $(archlibdir)/include/s && \
-		  chmod 755 $(archlibdir)/include/s; \
-		test -d $(archlibdir)/include/m && \
-		  chmod 755 $(archlibdir)/include/s;) \
+			(cd $(DESTDIR)$(archlibdir)/include && umask 022 && tar xf -); \
+		chmod 755 $(DESTDIR)$(archlibdir)/include; \
+		test -d $(DESTDIR)$(archlibdir)/include/s && \
+		  chmod 755 $(DESTDIR)$(archlibdir)/include/s; \
+		test -d $(DESTDIR)$(archlibdir)/include/m && \
+		  chmod 755 $(DESTDIR)$(archlibdir)/include/s;) \
 	done)
 #endif