Browse Source

Fixed make install

Fredrik Haikarainen 10 years ago
parent
commit
deea00f712
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      Makefile

+ 13
- 0
Makefile View File

@@ -1,3 +1,6 @@
1
+PREFIX=$(DESTDIR)/usr
2
+BINDIR=$(PREFIX)/bin
3
+
1 4
 CC=gcc
2 5
 CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include"
3 6
 
@@ -6,6 +9,16 @@ all:
6 9
 exp:
7 10
 	$(CC) $(CFLAGS) -E  src/helpers.c src/light.c
8 11
 
12
+install: all
13
+	mkdir -p $(BINDIR)
14
+	cp -f ./light $(BINDIR)/light
15
+	chown root $(BINDIR)/light
16
+	chmod 4755 $(BINDIR)/light
17
+
18
+uninstall:
19
+	rm $(BINDIR)/light
20
+	rm -rf /etc/light
21
+
9 22
 clean:
10 23
 	rm -vfr *~ light
11 24