git » libfiu » commit e7d1a46

Don't assume that we will use the library from the 'install' target's PREFIX

author Chris Lamb
2009-07-24 16:43:50 UTC
committer Chris Lamb
2009-07-24 17:27:30 UTC
parent 2b50abc3d52887bdef536038b03b4709f095e110

Don't assume that we will use the library from the 'install' target's PREFIX

This patch adds support for using the DESTDIR variable in the 'install'
target to represent the "eventual" destination of the library, decoupling
the installation directory and the run-time directory.

I'm using this so the pkgconfig file gets created with a "prefix" value
of my choice ("/usr") instead of somewhere under my home directory or
wherever I happen to be generating the Debian package from.

Signed-off-by: Chris Lamb <lamby@debian.org>

libfiu/Makefile +4 -1
libfiu/libfiu.pc.in +1 -1

diff --git a/libfiu/Makefile b/libfiu/Makefile
index f72c513..5730cb2 100644
--- a/libfiu/Makefile
+++ b/libfiu/Makefile
@@ -14,6 +14,9 @@ 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
 
@@ -38,7 +41,7 @@ all: libs libfiu.pc
 libfiu.pc: build-flags libfiu.pc.in
 	@echo "generating libfiu.pc"
 	@cat libfiu.pc.in | \
-		sed 's@++PREFIX++@$(PREFIX)@g' | \
+		sed 's@++DESTDIR++@$(DESTDIR)@g' | \
 		sed 's@++LIB_VER++@$(LIB_VER)@g' \
 		> libfiu.pc
 
diff --git a/libfiu/libfiu.pc.in b/libfiu/libfiu.pc.in
index de3e08b..937d57b 100644
--- a/libfiu/libfiu.pc.in
+++ b/libfiu/libfiu.pc.in
@@ -1,5 +1,5 @@
 
-prefix=++PREFIX++
+prefix=++DESTDIR++
 libdir=${prefix}/lib
 includedir=${prefix}/include