-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (74 loc) · 1.57 KB
/
Makefile
File metadata and controls
88 lines (74 loc) · 1.57 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
CC = gcc
RM = rm -f
LDFLAGS = -lhttp_parser
CFLAGS = \
-I. \
-Wall \
-std=gnu99 \
-fplan9-extensions \
-fms-extensions \
-D_GNU_SOURCE=
IFLAGS = \
-npcs \
-nut \
-as \
-bs \
-br \
-nce \
-ncdw \
-brf \
-brs \
-ts4 \
-bli4 \
-i4 \
-di4 \
-cli4 \
-sar \
-bc \
-bad \
-bap \
-bbb \
-sc \
-slc \
-sob \
-par
PREFIX = /usr/local
CLEAN = \
httploadc \
httploads \
*.o \
*.gcda \
*.gcda.info \
*.gcno \
*.gcov \
*.c~ \
*.h~ \
coverage.info \
capt-*.txt
client_headers := $(wildcard client*.h)
client_objects := $(client_headers:.h=.o)
server_headers := $(wildcard server*.h)
server_objects := $(server_headers:.h=.o)
headers_exclude := options.h common.h ansicolors.h
common_headers := $(filter-out $(headers_exclude), $(wildcard *.h))
common_headers := $(filter-out $(server_headers), $(common_headers))
common_headers := $(filter-out $(client_headers), $(common_headers))
common_objects := $(common_headers:.h=.o)
all: httploadc httploads
$(common_objects) $(server_objects) $(client_objects): %.o: %.c %.h
$(CC) $(CFLAGS) -o $@ $< -c $(LDFLAGS)
httploadc: client_main.c $(client_objects) $(common_objects)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
httploads: server_main.c $(server_objects) $(common_objects)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
include tests/Makefile
.PHONY: clean
clean::
-$(RM) -f $(CLEAN)
.PHONY: indent
indent::
indent $(IFLAGS) *.c *.h
indentbk = $(wildcard *.[hc]~)
.PHONY: indent-restore
indent-restore::
for f in $(indentbk:%~=%); do mv "$${f}~" "$${f}"; done