-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
56 lines (45 loc) · 1.1 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
TESTS = \
skinny-mutex \
tasklet \
threadpool \
heavy \
shutdown
TESTS := $(addprefix tests/test-,$(TESTS))
deps := $(TESTS:%=%.o.d)
.PHONY: all check clean
GIT_HOOKS := .git/hooks/applied
all: $(GIT_HOOKS) $(TESTS)
$(GIT_HOOKS):
@scripts/install-git-hooks
@echo
include common.mk
CFLAGS = -I./include
CFLAGS += -std=gnu11 -Wall -W
CFLAGS += -D_GNU_SOURCE
CFLAGS += -DUNUSED="__attribute__((unused))"
LDFLAGS = -lpthread
TESTS_OK = $(TESTS:=.ok)
check: $(TESTS_OK)
$(TESTS_OK): %.ok: %
$(Q)$(PRINTF) "*** Validating $< ***\n"
$(Q)./$< && $(PRINTF) "\t$(PASS_COLOR)[ Verified ]$(NO_COLOR)\n"
@touch $@
# standard build rules
.SUFFIXES: .o .c
.c.o:
$(VECHO) " CC\t$@\n"
$(Q)$(CC) -o $@ $(CFLAGS) -c -MMD -MF $@.d $<
OBJS = \
src/skinny_mutex.o \
src/thread.o \
src/tasklet.o \
src/threadpool.o \
src/threadtracer.o
deps += $(OBJS:%.o=%.o.d)
$(TESTS): %: %.o $(OBJS)
$(VECHO) " LD\t$@\n"
$(Q)$(CC) -o $@ $^ $(LDFLAGS)
clean:
$(VECHO) " Cleaning...\n"
$(Q)$(RM) $(TESTS) $(TESTS_OK) $(TESTS:=.o) $(OBJS) threadtracer*.json $(deps)
-include $(deps)