-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
66 lines (48 loc) · 1.67 KB
/
makefile
File metadata and controls
66 lines (48 loc) · 1.67 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
# ======================
# Compiler & Flags
# ======================
CC = gcc
CFLAGS = -g3 -ggdb -O1 \
-Wall -Wextra -Wpedantic -Wshadow -Wformat=2 -Wconversion \
-Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough \
-Wcast-align -Wstrict-aliasing=3 -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wunused-parameter -Wfloat-equal \
-Winit-self -Wuninitialized -Wswitch-enum -Wredundant-decls \
-Wpointer-arith -Wvla \
-Werror \
-fsanitize=address,undefined,leak,pointer-compare,pointer-subtract,alignment \
-fsanitize=bounds,float-cast-overflow,float-divide-by-zero \
-fsanitize=signed-integer-overflow \
-fno-omit-frame-pointer -fno-optimize-sibling-calls \
-fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC \
-std=c11 -msse -mfpmath=sse \
-Iinclude -Isrc/structures
LDFLAGS = -fsanitize=undefined,address,leak -lm
# ======================
# Source files
# ======================
SERVER_SRC = src/server/server.c
PARSER_SRC = src/server/parser.c
ROUTE_SRC = src/server/route.c
HTTP_SRC = src/server/http.c
DICT_SRC = src/structs/dict/dict.c
ENTRY_SRC = src/structs/dict/entry.c
QUEUE_SRC = src/structs/queue/queue.c
QUEUE_NODE_SRC = src/structs/queue/queue_node.c
# ======================
# Tests
# ======================
SERVER_TEST = tests/test.c
# ======================
# Build rules
# ======================
all: run_server
run_server: $(SERVER_SRC) $(SERVER_TEST) $(PARSER_SRC) $(DICT_SRC) $(ENTRY_SRC) $(QUEUE_SRC) $(QUEUE_NODE_SRC) $(HTTP_SRC) $(ROUTE_SRC)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
# ======================
# Cleanup
# ======================
clean:
rm run_server
find . -name '*.o' -delete
.PHONY: all clean