-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
85 lines (65 loc) · 1.47 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
CC = cc
GCOV = gcov
CFLAGS = $(DCFLAGS) -Wall -I. -I..
LDFLAGS += -lc $(DLDFLAGS)
SOURCES = \
timestamp_compare.c \
timestamp_format.c \
timestamp_parse.c \
timestamp_valid.c \
timestamp_tm.c
OBJECTS = \
timestamp_compare.o \
timestamp_format.o \
timestamp_parse.o \
timestamp_valid.o \
timestamp_tm.o
HARNESS_OBJS = \
t/valid.o \
t/compare.o \
t/format.o \
t/parse_wellformed.o \
t/parse_malformed.o \
t/tm.o
HARNESS_EXES = \
t/valid.t \
t/compare.t \
t/format.t \
t/parse_wellformed.t \
t/parse_malformed.t \
t/tm.t
HARNESS_DEPS = \
$(OBJECTS) \
t/tap.o
.SUFFIXES:
.SUFFIXES: .o .c .t
.PHONY: check-asan test gcov cover clean
.o.t:
$(CC) $(LDFLAGS) $< $(HARNESS_DEPS) -o $@
t/valid.o: \
$(HARNESS_DEPS) t/valid.c
t/compare.o: \
$(HARNESS_DEPS) t/compare.c
t/format.o: \
$(HARNESS_DEPS) t/format.c
t/parse_wellformed.o: \
$(HARNESS_DEPS) t/parse_wellformed.c
t/parse_malformed.o: \
$(HARNESS_DEPS) t/parse_malformed.c
t/tm.o: \
$(HARNESS_DEPS) t/tm.c
test: $(HARNESS_EXES)
@prove $(HARNESS_EXES)
check-asan:
@$(MAKE) DCFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer" \
DLDFLAGS="-g -fsanitize=address" test
gcov:
@$(MAKE) DCFLAGS="-O0 -g -coverage" DLDFLAGS="-coverage" test
@$(GCOV) $(SOURCES)
cover:
@$(MAKE) DCFLAGS="-O0 -g --coverage" DLDFLAGS="-coverage" test
@$(GCOV) -abc $(SOURCES)
@gcov2perl *.gcov
@cover --no-gcov
clean:
rm -f $(HARNESS_DEPS) $(HARNESS_OBJS) $(HARNESS_EXES) *.gc{ov,da,no} t/*.gc{ov,da,no}