From cd8a7c310ceb386b40b4cec74d527b49acb9fd3f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 23 May 2013 22:05:50 +0200 Subject: [PATCH] Add DESTDIR as prefix to extension destination The `pkg-config' program needs to know about the prefix DESTDIR to determine where the files in `src/' should be installed. If this option is not passed along to `pkg-config' it will always try to install in `/usr/'. --- src/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 30ba106..f7f6827 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,8 @@ DESTDIR ?= /usr/local CFLAGS = $(shell pkg-config --cflags guile-2.0) -fPIC LDFLAGS = $(shell pkg-config --libs guile-2.0) +EXTDIR = $(shell pkg-config guile-2.0 --variable=extensiondir \ + --define-variable=prefix=$(DESTDIR)) objects = gitto-path.o @@ -18,10 +20,9 @@ libguile-gitto-path.so: gitto-path.o install-gitto: gitto install -Dm 755 $^ ${DESTDIR}/bin/$^ install-libguile-gitto-path: libguile-gitto-path.so - install -Dm 755 $^ \ - $(shell pkg-config guile-2.0 --variable=extensiondir)/$^ + install -Dm 755 $^ ${EXTDIR}/$^ install: install-gitto install-libguile-gitto-path uninstall: rm -f ${DESTDIR}/bin/gitto - rm -f $(shell pkg-config guile-2.0 --variable=extensiondir)/libguile-gitto-path.so + rm -f ${EXTDIR}/libguile-gitto-path.so