add installation support to Makefile
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Ben Walton committed
Nov 13, 2009 at 20:29 UTC
0d31de303f9e8e28cc1649dbf41c1cc635bae2d8
1 file changed
+20
Makefile
+20
@@ -1,3 +1,13 @@
1
+prefix ?= /usr/local
2
+mandir ?= $(prefix)/share/man
3
+gitdir ?= $(shell git --exec-path)
4
+
5
+# this should be set to a 'standard' bsd-type install program
6
+INSTALL ?= install
7
+INSTALL_DATA = $(INSTALL) -c -m 0644
8
+INSTALL_EXE = $(INSTALL) -c -m 0755
9
+INSTALL_DIR = $(INSTALL) -c -d -m 0755
10
+
11
default:
12
@echo "git-subtree doesn't need to be built."
13
@echo "Just copy it somewhere on your PATH, like /usr/local/bin."
@@ -5,6 +15,16 @@ default:
15
@echo "Try: make doc"
16
@false
17
18
+install: install-exe install-doc
19
+
20
+install-exe: git-subtree.sh
21
+ $(INSTALL_DIR) $(DESTDIR)/$(gitdir)
22
+ $(INSTALL_EXE) $< $(DESTDIR)/$(gitdir)/git-subtree
23
+
24
+install-doc: git-subtree.1
25
+ $(INSTALL_DIR) $(DESTDIR)/$(mandir)/man1/
26
+ $(INSTALL_DATA) $< $(DESTDIR)/$(mandir)/man1/
27
+
28
doc: git-subtree.1
29
30
%.1: %.xml