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/'.
This commit is contained in:
Tom Willemse 2013-05-23 22:05:50 +02:00
parent 1be9047b00
commit cd8a7c310c

View file

@ -1,6 +1,8 @@
DESTDIR ?= /usr/local DESTDIR ?= /usr/local
CFLAGS = $(shell pkg-config --cflags guile-2.0) -fPIC CFLAGS = $(shell pkg-config --cflags guile-2.0) -fPIC
LDFLAGS = $(shell pkg-config --libs guile-2.0) 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 objects = gitto-path.o
@ -18,10 +20,9 @@ libguile-gitto-path.so: gitto-path.o
install-gitto: gitto install-gitto: gitto
install -Dm 755 $^ ${DESTDIR}/bin/$^ install -Dm 755 $^ ${DESTDIR}/bin/$^
install-libguile-gitto-path: libguile-gitto-path.so install-libguile-gitto-path: libguile-gitto-path.so
install -Dm 755 $^ \ install -Dm 755 $^ ${EXTDIR}/$^
$(shell pkg-config guile-2.0 --variable=extensiondir)/$^
install: install-gitto install-libguile-gitto-path install: install-gitto install-libguile-gitto-path
uninstall: uninstall:
rm -f ${DESTDIR}/bin/gitto 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