-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
36 lines (26 loc) · 798 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
# I am not very good at Makefiles.
CFLAGS += -g -O3 -Wall -Wextra -Wstrict-aliasing=2 -Wno-unused-function
ifeq "$(CC)" "clang"
CFLAGS += -Weverything -Wno-padded
# stop clang warning us about strncmp/vsprintf:
CFLAGS += -Wno-disabled-macro-expansion -Wno-format-nonliteral
endif
all: test
test: bin/tests
@bin/tests
bin obj:
mkdir -p $@
clean:
@rm -rf bin obj
obj/%.o: %.c %.h | obj
$(CC) -o $@ -c $< $(CFLAGS) $(INCLUDES)
obj/test_%.o: test_%.c %.h | obj
$(CC) -o $@ -c $< $(CFLAGS) $(INCLUDES)
bin/tests: tests.c obj/CuTest.o \
obj/test_selist.o obj/selist.o \
obj/test_l10n.o obj/l10n.o \
obj/test_strings.o obj/strings.o \
obj/test_critbit.o obj/critbit.o \
obj/test_format.o obj/format.o \
obj/test_strutil.o obj/strutil.o | bin
$(CC) $(CFLAGS) $(INCLUDES) -lm $^ -o $@