forked from sysprog21/prefix-search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 713 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
45
46
47
48
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
OBJS := \
$(OBJS_LIB) \
test_cpy.o \
test_ref.o
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 $<
clean:
$(RM) $(TESTS) $(OBJS)
$(RM) $(deps)
-include $(deps)