Lines 1-25
Link Here
|
1 |
--- Makefile.orig 2017-01-14 22:53:30 UTC |
1 |
--- Makefile.orig 2022-07-10 02:56:04 UTC |
2 |
+++ Makefile |
2 |
+++ Makefile |
3 |
@@ -1,17 +1,9 @@ |
3 |
@@ -1,42 +1,14 @@ |
4 |
-CC=gcc |
4 |
-CC=gcc |
5 |
-CFLAGS=-W -Wall -Wextra -O2 -fstack-protector-all |
5 |
-CFLAGS=-W -Wall -Wextra -Wformat-security -Wno-maybe-uninitialized -O2 |
6 |
-DFLAGS=-D_FORTIFY_SOURCE=2 |
6 |
-HARDENING=-fstack-protector-all -pie -fPIE |
|
|
7 |
+CC?=gcc |
8 |
+CFLAGS+=-W -Wall -Wextra -fstack-protector-all |
9 |
+DFLAGS=-D_FORTIFY_SOURCE=2 -I /usr/local/include -I src/headers |
10 |
+LDFLAGS=-Wl,-z,relro,-z,now,-L,/usr/local/lib,-lcurl,-lpthread |
11 |
DIR=src/ |
12 |
DIROUT=bin/ |
13 |
DIR_HEADERS=src/headers/ |
7 |
-UNAME_S := $(shell uname -s) |
14 |
-UNAME_S := $(shell uname -s) |
8 |
-ifeq ($(UNAME_S),Darwin) |
15 |
-ifeq ($(UNAME_S),Darwin) |
9 |
- LDFLAGS=-Wl,-lcurl |
16 |
- LDFLAGS=-Wl,-lcurl, -lpthread |
10 |
-else |
17 |
-else |
11 |
- LDFLAGS=-Wl,-z,relro,-z,now -lcurl |
18 |
- LDFLAGS=-Wl,-z,relro,-z,now -lcurl -lpthread |
12 |
-endif |
19 |
-endif |
13 |
- |
|
|
14 |
-#LDFLAGS=-lcurl |
15 |
- |
16 |
+CC?=cc |
17 |
+CFLAGS+=-W -Wall -Wextra -fstack-protector-all |
18 |
+DFLAGS=-D_FORTIFY_SOURCE=2 -I /usr/local/include |
19 |
+LDFLAGS=-Wl,-z,relro,-z,now,-L,/usr/local/lib,-lcurl |
20 |
|
20 |
|
21 |
-0d1n: 0d1n.c |
|
|
22 |
+all: 0d1n.c |
23 |
$(CC) $(CFLAGS) $(DFLAGS) -c *.c |
24 |
$(CC) -o 0d1n *.o $(LDFLAGS) |
25 |
|
21 |
|
|
|
22 |
+all: $(DIR)0d1n.c |
23 |
+ $(CC) $(CFLAGS) $(DFLAGS) -c $(DIR)*.c |
24 |
+ $(CC) -o 0d1n *.o $(LDFLAGS) |
25 |
|
26 |
-0d1n: $(DIR)0d1n.c |
27 |
- $(CC) $(CFLAGS) $(HARDENING) -c $(DIR)*.c -I$(DIR_HEADERS) |
28 |
- $(CC) $(HARDENING) -o $(DIROUT)0d1n *.o $(LDFLAGS) |
29 |
|
30 |
-clean: |
31 |
- rm -f *.o 0d1n |
32 |
- |
33 |
-PREFIX=/usr/local |
34 |
-install: |
35 |
- make |
36 |
- mkdir -p $(DESTDIR)$(PREFIX)/bin |
37 |
- install -m 0755 bin/0d1n $(DESTDIR)$(PREFIX)/bin |
38 |
- mkdir /opt/0d1n |
39 |
- mkdir /opt/0d1n/view/ |
40 |
- mkdir /opt/0d1n/view/response_sources |
41 |
- mkdir /opt/0d1n/payloads |
42 |
- cp -rf templates /opt/0d1n/ |
43 |
- cp -rf tables /opt/0d1n/view/ |
44 |
- cp -rf payloads /opt/0d1n/ |
45 |
- chmod 0755 -R /opt/0d1n |
46 |
- chown ${USER} -R /opt/0d1n |
47 |
- chown ${USER} $(DESTDIR)$(PREFIX)/bin/0d1n |
48 |
- |
49 |
-uninstall: |
50 |
- rm $(DESTDIR)$(PREFIX)/bin/0d1n |
51 |
- rm -rf /opt/0d1n |
52 |
- rm -f *.o 0d1n |