forked from sysprog21/prefix-search
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (45 loc) · 809 Bytes
/
Makefile
File metadata and controls
61 lines (45 loc) · 809 Bytes
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
57
58
59
60
61
TESTS = \
test_cpy \
test_ref
CFLAGS = -Wall -Werror -g
# Control the build verbosity
ifeq ("$(VERBOSE)","1")
Q :=
VECHO = @true
else
Q := @
VECHO = @printf
endif
GIT_HOOKS := .git/hooks/applied
.PHONY: all clean
all: $(GIT_HOOKS) $(TESTS)
$(GIT_HOOKS):
@scripts/install-git-hooks
@echo
OBJS_LIB = \
tst.o \
bench.o
OBJS := \
$(OBJS_LIB) \
test_cpy.o \
test_ref.o
BIN = \
test_cpy \
test_ref
deps := $(OBJS:%.o=.%.o.d)
test_%: test_%.o $(OBJS_LIB)
$(VECHO) " LD\t$@\n"
$(Q)$(CC) $(LDFLAGS) -o $@ $^
%.o: %.c
$(VECHO) " CC\t$@\n"
$(Q)$(CC) -o $@ $(CFLAGS) -c -MMD -MF .$@.d $<
bench: $(BIN)
@for test in $(BIN); do\
./$$test --bench; \
done
plot:
@gnuplot scripts/runtime.gp
clean:
$(RM) $(TESTS) $(OBJS)
$(RM) $(deps)
-include $(deps)