cgit

commit 97ded7c1c37078d34c0213d72777fdff3b6aebda

Author: Chris Pickel <sfiera@macports.org>

Makefile: add support for DESTDIR

Signed-off-by: Lars Hjemli <hjemli@gmail.com>

 Makefile | 14 +++++++-------


diff --git a/Makefile b/Makefile
index 2fbdf6734973818f3b6670d50c6058f652a92a03..d95a5a3129ac2b967befdd45f77a7648c0eb3857 100644
--- a/Makefile
+++ b/Makefile
@@ -49,15 +49,15 @@ 	cd git && $(MAKE) xdiff/lib.a
 	cd git && $(MAKE) libgit.a
 
 install: all
-	mkdir -p $(CGIT_SCRIPT_PATH)
-	install cgit $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
-	install cgit.css $(CGIT_SCRIPT_PATH)/cgit.css
-	rm -rf $(CACHE_ROOT)/*
+	mkdir -p $(DESTDIR)$(CGIT_SCRIPT_PATH)
+	install cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
+	install cgit.css $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.css
+	rm -rf $(DESTDIR)$(CACHE_ROOT)/*
 
 uninstall:
-	rm -f $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
-	rm -f $(CGIT_SCRIPT_PATH)/cgit.css
-	rm -rf $(CACHE_ROOT)
+	rm -f $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
+	rm -f $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.css
+	rm -rf $(DESTDIR)$(CACHE_ROOT)
 
 clean:
 	rm -f cgit VERSION *.o