|
@@ -1,6 +1,8 @@
|
1
|
|
-PREFIX=$(DESTDIR)/usr
|
2
|
|
-BINDIR=$(PREFIX)/bin
|
3
|
|
-MANDIR=$(PREFIX)/share/man/man1
|
|
1
|
+ifeq ($(PREFIX),)
|
|
2
|
+ PREFIX := /usr
|
|
3
|
+endif
|
|
4
|
+BINDIR=$(DESTDIR)$(PREFIX)/bin
|
|
5
|
+MANDIR=$(DESTDIR)$(PREFIX)/share/man/man1
|
4
|
6
|
|
5
|
7
|
CC=gcc
|
6
|
8
|
CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include" -D_XOPEN_SOURCE=500
|
|
@@ -9,17 +11,15 @@ light: src/helpers.c src/light.c src/main.c
|
9
|
11
|
$(CC) $(CFLAGS) -g -o $@ $^
|
10
|
12
|
|
11
|
13
|
install: light
|
12
|
|
- mkdir -p $(BINDIR)
|
13
|
|
- cp -f ./light $(BINDIR)/light
|
14
|
|
- chown root $(BINDIR)/light
|
15
|
|
- chmod 4755 $(BINDIR)/light
|
16
|
|
- mkdir -p $(MANDIR)
|
17
|
|
- cp -f light.1 $(MANDIR)
|
|
14
|
+ install -dZ $(BINDIR)
|
|
15
|
+ install -DZ -m 4755 ./light -t $(BINDIR)
|
|
16
|
+ install -dZ $(MANDIR)
|
|
17
|
+ install -DZ light.1 -t $(MANDIR)
|
18
|
18
|
|
19
|
19
|
uninstall:
|
20
|
|
- rm $(BINDIR)/light
|
|
20
|
+ rm -f $(BINDIR)/light
|
21
|
21
|
rm -rf /etc/light
|
22
|
|
- rm $(MANDIR)/light.1.gz
|
|
22
|
+ rm -f $(MANDIR)/light.1.gz
|
23
|
23
|
|
24
|
24
|
clean:
|
25
|
25
|
rm -vfr *~ light light.1.gz
|