aboutsummaryrefslogtreecommitdiff
path: root/cem/grabc/patches/better-makefile.patch
blob: 5fe735d7ce7cd903628e2e11c15e6210dc231ac1 (plain)
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
38
39
40
41
42
43
diff --git a/Makefile b/Makefile
index 5de8e52..9c17c2d 100644
--- a/Makefile
+++ b/Makefile
@@ -12,8 +12,9 @@ cp=/bin/cp -fv
 DESTDIR = 
 binary=./grabc
 manpage=./grabc.1
-bindir=/usr/local/bin
-mandir=/usr/local/share/man/man1
+PREFIX = /usr/local
+bindir=${PREFIX}/bin
+mandir=${PREFIX}/share/man/man1
 
 # replace -O with -g in order to debug
 
@@ -33,20 +34,16 @@ all: $(PROGNAME)
 $(PROGNAME) : $(OBJS)
 	$(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)
 
-doc:
+grabc.1:
 	pod2man grabc.pod > grabc.1
 
-install: installdirs install-bin install-man
+install: install-bin install-man
 
-install-bin:
-	${cp} ${binary} ${DESTDIR}${bindir}
+install-bin: grabc
+	install -Dm755 -t ${DESTDIR}${bindir} ${binary}
 
-installdirs:
-	$(SHELL) ./mkinstalldirs ${DESTDIR}${bindir}
-	$(SHELL) ./mkinstalldirs ${DESTDIR}${mandir}
-
-install-man:
-	${cp} ${manpage} ${DESTDIR}${mandir}
+install-man: grabc.1
+	install -Dm644 -t ${DESTDIR}${mandir} ${manpage} 
 
 deb:
 	/bin/rm -f *.deb