Add DESTDIR support. Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/Makefile b/Makefile
index 3ae3c85..e032d86 100644
--- a/Makefile
+++ b/Makefile
@@ -61,22 +61,22 @@ install-headers: $(PUBLIC_HEADERS)
@for i in $^; do cat .HEADER $$i > /tmp/gitinc/$${i##src/}; done
install: $(GIT_LIB) $(PUBLIC_HEADERS) libgit2.pc
- @mkdir -p $(prefix)/include/git
+ @mkdir -p $(DESTDIR)/$(prefix)/include/git
@for i in $(PUBLIC_HEADERS); do \
- cat .HEADER $$i > $(prefix)/include/$${i##src/}; \
+ cat .HEADER $$i > $(DESTDIR)/$(prefix)/include/$${i##src/}; \
done
- @mkdir -p $(prefix)/lib
- @cp -f $(GIT_LIB) $(prefix)/lib/libgit2.a
- @mkdir -p $(prefix)/lib/pkgconfig
- @cp -f libgit2.pc $(prefix)/lib/pkgconfig/libgit2.pc
+ @mkdir -p $(DESTDIR)/$(prefix)/lib
+ @cp -f $(GIT_LIB) $(DESTDIR)/$(prefix)/lib/libgit2.a
+ @mkdir -p $(DESTDIR)/$(prefix)/lib/pkgconfig
+ @cp -f libgit2.pc $(DESTDIR)/$(prefix)/lib/pkgconfig/libgit2.pc
uninstall:
- @rm -f $(prefix)/lib/libgit2.a
- @rm -f $(prefix)/lib/pkgconfig/libgit2.pc
+ @rm -f $(DESTDIR)/$(prefix)/lib/libgit2.a
+ @rm -f $(DESTDIR)/$(prefix)/lib/pkgconfig/libgit2.pc
@for i in $(PUBLIC_HEADERS); do \
- rm -f $(prefix)/include/$${i##src/}; \
+ rm -f $(DESTDIR)/$(prefix)/include/$${i##src/}; \
done
- @rmdir $(prefix)/include/git
+ @rmdir $(DESTDIR)/$(prefix)/include/git
.c.o:
$(CC) $(ALL_CFLAGS) -c $< -o $@