summaryrefslogtreecommitdiff
blob: 2a3e50c8c9d6a60ad4af9048c56f8e267fea0aa6 (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
--- Makefile
+++ Makefile
@@ -1,16 +1,18 @@
 # Makefile for minised
 
+DESTDIR=
 PREFIX=/usr
 
 minised: sedcomp.o sedexec.o
-	$(CC) $(LFLAGS) sedcomp.o sedexec.o -o minised
+	$(CC) $(LDFLAGS) $^ -o $@
 
 sedcomp.o: sedcomp.c sed.h
 sedexec.o: sedexec.c sed.h
 
 install:
-	install minised $(PREFIX)/bin/
-	install minised.1 $(PREFIX)/man/man1/
+	install -d -m 755 $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1
+	install -m 755 minised $(DESTDIR)$(PREFIX)/bin/
+	install -m 644 minised.1 $(DESTDIR)$(PREFIX)/share/man/man1/
 
 clean:
 	rm -f minised sedcomp.o sedexec.o