blob: 883e2087b3e699264796fb756b5ee4cec88be005 (
plain) (
blame)
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
|
CC=gcc
#CFLAGS=-Wall -Wextra -Wpedantic -g
#LDFLAGS=-lncurses -lmagic
CFLAGS=-Wall -Wextra -Wpedantic -Wstrict-prototypes -Wmissing-prototypes -g
#LDFLAGS=-lncurses -lmagic -fsanitize=address -fsanitize=undefined
LDFLAGS=-lncurses -lmagic
TARGET=sf
SRCS=$(wildcard *.c)
OBJS=$(SRCS:.c=.o)
TEST_SRC=test/fm_draw_entries.c
TEST_OBJ=dir.o mem.o err.o log.o
TEST_BIN=fm_draw_entries
.PHONY: all test clean
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
test: $(TEST_OBJ) $(TEST_SRC)
$(CC) $(CFLAGS) $(TEST_SRC) $(TEST_OBJ) -o $(TEST_BIN) $(TESTLDFLAGS)
./$(TEST_BIN)
@rm -f $(TEST_BIN)
debug: $(TARGET)
$(CC) $(OBJS) $(LDFLAGS) -O0 -o $@
valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --undef-value-errors=no --log-file=log ./sf
analyze:
cppcheck --enable=all --suppress=missingIncludeSystem .
clang --analyze *.c
clean:
rm -f $(OBJS) $(TARGET)
rm -f ./asan*
|