-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
42 lines (31 loc) · 1.07 KB
/
Copy pathmakefile
File metadata and controls
42 lines (31 loc) · 1.07 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
# 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
LDFLAGS = -fsanitize=undefined,address,leak -lm
# src files / test files
QUEUE_SRC = src/queue.c
EXEC_SRC = src/executor.c
TEST_SRC = tests/main.c
# build rules
all: exec
exec: $(QUEUE_SRC) $(EXEC_SRC) $(TEST_SRC)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
# cleanup
clean:
rm exec
find . -name '*.o' -delete
.PHONY: all clean