[PATCH 3/3] Add support for DESTDIR variable for offset installation.

Diego 'Flameeyes' Pettenò flamee... at gmail.com
Wed Oct 1 11:13:11 UTC 2008


Most distributions use the DESTDIR variable to install the package
just built in a temporary tree used to build the package; such an
option can also be used to test that the software is getting installed
properly.

Add support for this variable by prefixing all paths used during
installation with $(DESTDIR).
---

 doc/Makefile.in       |   18 +++++++++---------
 ragel/Makefile.in     |    4 ++--
 rlgen-dot/Makefile.in |    4 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/doc/Makefile.in b/doc/Makefile.in
index 9d2ded2..a6ff456 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -66,16 +66,16 @@ distclean: clean
 man: $(MANPAGES)
 
 man-install: man
-	install -d $(mandir)/man1
-	install -m 644 ragel.1      $(mandir)/man1/ragel.1
-	install -m 644 rlgen-dot.1  $(mandir)/man1/rlgen-dot.1
-	install -m 644 rlgen-cd.1   $(mandir)/man1/rlgen-cd.1
-	install -m 644 rlgen-java.1 $(mandir)/man1/rlgen-java.1
-	install -m 644 rlgen-ruby.1 $(mandir)/man1/rlgen-ruby.1
+	install -d $(DESTDIR)$(mandir)/man1
+	install -m 644 ragel.1      (DESTDIR)$(mandir)/man1/ragel.1
+	install -m 644 rlgen-dot.1  (DESTDIR)$(mandir)/man1/rlgen-dot.1
+	install -m 644 rlgen-cd.1   (DESTDIR)$(mandir)/man1/rlgen-cd.1
+	install -m 644 rlgen-java.1 (DESTDIR)$(mandir)/man1/rlgen-java.1
+	install -m 644 rlgen-ruby.1 (DESTDIR)$(mandir)/man1/rlgen-ruby.1
 
 install: all man-install
-	install -d $(docdir)
-	install -m 644 ragel-guide.pdf $(docdir)/ragel-guide.pdf
+	install -d $(DESTDIR)$(docdir)
+	install -m 644 ragel-guide.pdf $(DESTDIR)$(docdir)/ragel-guide.pdf
 	gzip -c ../ChangeLog > ChangeLog.gz
-	install -m 644 ChangeLog.gz $(docdir)/ChangeLog.gz
+	install -m 644 ChangeLog.gz $(DESTDIR)$(docdir)/ChangeLog.gz
 	rm ChangeLog.gz
diff --git a/ragel/Makefile.in b/ragel/Makefile.in
index 3a23267..b6397dc 100644
--- a/ragel/Makefile.in
+++ b/ragel/Makefile.in
@@ -95,7 +95,7 @@ clean:
 	rm -f tags .*.d *.o ragel $(EXTRA_CLEAN)
 
 install: all
-	install -d $(prefix)/bin
-	install ragel $(prefix)/bin/ragel
+	install -d $(DESTDIR)$(prefix)/bin
+	install ragel $(DESTDIR)$(prefix)/bin/ragel
 
 -include $(DEPS)
diff --git a/rlgen-dot/Makefile.in b/rlgen-dot/Makefile.in
index 8decf2b..5d33931 100644
--- a/rlgen-dot/Makefile.in
+++ b/rlgen-dot/Makefile.in
@@ -62,7 +62,7 @@ clean:
 	rm -f tags .*.d *.o rlgen-dot $(EXTRA_CLEAN)
 
 install: all
-	install -d $(prefix)/bin
-	install rlgen-dot $(prefix)/bin/rlgen-dot
+	install -d $(DESTDIR)$(prefix)/bin
+	install rlgen-dot $(DESTDIR)$(prefix)/bin/rlgen-dot
 
 -include $(DEPS)



More information about the ragel-users mailing list