forked from mattconte/tlsf
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
44 lines (32 loc) · 859 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
36
37
38
39
40
41
42
43
44
OUT = build
TARGETS = \
test \
bench
TARGETS := $(addprefix $(OUT)/,$(TARGETS))
all: $(TARGETS)
test: all
./build/bench
./build/bench -s 32
./build/bench -s 10:12345
./build/test
CFLAGS += \
-std=gnu11 -g -O2 \
-Wall -Wextra -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -Wc++-compat \
-DTLSF_ENABLE_ASSERT -DTLSF_ENABLE_CHECK
OBJS = tlsf.o
OBJS := $(addprefix $(OUT)/,$(OBJS))
deps := $(OBJS:%.o=%.o.d)
$(OUT)/test: $(OBJS) test.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
$(OUT)/bench: $(OBJS) bench.c
$(CC) $(CFLAGS) -o $@ -MMD -MF $@.d $^ $(LDFLAGS)
$(OUT)/%.o: %.c
@mkdir -p $(OUT)
$(CC) $(CFLAGS) -c -o $@ -MMD -MF $@.d $<
CMDSEP = ; echo "Please wait..." ;
check: $(TARGETS)
MALLOC_CHECK_=3 $(foreach prog,$(TARGETS),./$(prog) $(CMDSEP))
clean:
$(RM) $(TARGETS) $(OBJS) $(deps)
.PHONY: all check clean test
-include $(deps)