-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
35 lines (26 loc) · 799 Bytes
/
makefile
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
BIN_DIR = bin
SRC_DIR = src
TEST_DIR = tests
CFLAGS = -I$(SRC_DIR) -g -O3 -Wall -Wextra -flto -std=c17 -march=native
SRCS = $(shell find $(SRC_DIR) -type f -iname '*.c')
OBJS = $(SRCS:.c=.o)
.build: $(OBJS)
.convert: .build
$(CC) $(CFLAGS) -o convert $(BIN_DIR)/convert.c $(OBJS) -lm
.extract: .build
$(CC) $(CFLAGS) -o extract $(BIN_DIR)/extract.c $(OBJS) -lm
all: build
build: .convert .extract
for tbuild: CFLAGS += -fsanitize=address -D LOG_TRACE
tbuild: .convert .extract
for dbuild: CFLAGS += -fsanitize=address -D LOG_DEBUG -O0
dbuild: .convert .extract
for test: CFLAGS += -fsanitize=address -D LOG_DEBUG -O0
test: .build
gcc $(CFLAGS) -o test_runner $(TEST_DIR)/*.c $(OBJS) -lcriterion -lm
./test_runner
clean:
rm -f classify
rm -f convert
rm -f extract
rm -f test_runner