git » libjio » commit 2464983

Decouple PREFIX and DESTDIR

author Alberto Bertogli
2009-07-24 23:38:11 UTC
committer Alberto Bertogli
2009-07-24 23:38:11 UTC
parent 4443d073e7a32e37b679ff6714f8fb9644b44b79

Decouple PREFIX and DESTDIR

Sometimes we want to do a "fake install" and then manually move the
result binaries somewhere else. This patch allows that by adding a new
DESTDIR variable that can be used to tell the real final location of the
binaries.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libjio/Makefile +3 -1

diff --git a/libjio/Makefile b/libjio/Makefile
index 9a82a94..157022e 100644
--- a/libjio/Makefile
+++ b/libjio/Makefile
@@ -33,6 +33,8 @@ endif
 # prefix for installing the binaries
 PREFIX = /usr/local
 
+# prefix for eventual location of binaries
+DESTDIR=$(PREFIX)
 
 # install utility, we assume it's GNU/BSD compatible
 INSTALL=install
@@ -64,7 +66,7 @@ libjio.a: $(OBJS)
 libjio.pc: libjio.skel.pc
 	@echo "generating libjio.pc"
 	@cat libjio.skel.pc | \
-		sed 's@++PREFIX++@$(PREFIX)@g' | \
+		sed 's@++PREFIX++@$(DESTDIR)@g' | \
 		sed 's@++CFLAGS++@$(MANDATORY_CFLAGS)@g' \
 		> libjio.pc