aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ijq/makefile-destdir.patch
blob: 1136a071bde77e155c7711d4b06a1753287856c7 (plain) (blame)
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
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
-prefix = /usr/local
-bindir = $(prefix)/bin
-mandir = $(prefix)/share/man
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+MANDIR = $(PREFIX)/share/man
 
 SRCS = main.go
 
@@ -20,13 +20,13 @@
 
 .PHONY: install
 install: ijq ijq.1
-	install -d $(bindir) $(mandir)/man1
-	install -m 0755 ijq $(bindir)
-	install -m 0644 ijq.1 $(mandir)/man1
+	install -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
+	install -m 0755 ijq -t $(DESTDIR)$(BINDIR)/
+	install -m 0644 ijq.1 -t $(DESTDIR)$(MANDIR)/man1/
 
 .PHONY: uninstall
 uninstall:
-	rm $(bindir)/ijq $(mandir)/man1/ijq.1
+	rm $(BINDIR)/ijq $(MANDIR)/man1/ijq.1
 
 .PHONY: clean
 clean: