/
Makefile
79 lines (59 loc) · 2.45 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
.PHONY : test
OPTIMIZE = -g
INCLUDE = -I.
CC = gcc
WARNINGS = -Wall -ansi -pedantic -Wno-long-long -Wextra -Wdeclaration-after-statement -Wendif-labels -Wconversion
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(INCLUDE)
COMPILE = $(CC) $(CFLAGS)
LINK = $(COMPILE)
all : time64.o
time64.o : time64_config.h time64.h time64.c Makefile
t/bench : t/bench.c time64.o
$(LINK) time64.o t/bench.c -o $@
bench : t/bench
time t/bench
t/localtime_test : t/localtime_test.c time64.o
$(LINK) time64.o t/localtime_test.c -o $@
t/gmtime_test : t/gmtime_test.c time64.o
$(LINK) time64.o t/gmtime_test.c -o $@
t/year_limit.t : t/tap.c t/year_limit.t.c time64.o
$(LINK) time64.o t/year_limit.t.c -o $@
t/negative.t : t/tap.c t/negative.t.c time64.o
$(LINK) time64.o t/negative.t.c -o $@
t/overflow.t : t/tap.c t/overflow.t.c time64.o
$(LINK) time64.o t/overflow.t.c -o $@
t/timegm.t : t/tap.c t/timegm.t.c time64.o
$(LINK) time64.o t/timegm.t.c -o $@
t/safe_year.t : t/tap.c t/safe_year.t.c time64.c
$(LINK) t/safe_year.t.c -o $@
t/gmtime64.t : t/tap.c t/gmtime64.t.c time64.o
$(LINK) time64.o t/gmtime64.t.c -o $@
t/mktime64.t : t/tap.c t/mktime64.t.c time64.o
$(LINK) time64.o t/mktime64.t.c -o $@
t/seconds_between_years.t : t/tap.c t/seconds_between_years.t.c time64.c
$(LINK) t/seconds_between_years.t.c -o $@
test : tap_tests localtime_tests
localtime_tests: t/localtime_test t/gmtime_test
@which bzdiff > /dev/null || (echo 'You need bzdiff to run these tests'; exit 1)
@which less > /dev/null || (echo 'You need less to run these tests'; exit 1)
@echo "On failure, these tests will produce a diff between the failed and expected results. If they pass they'll be quiet."
TZ=Canada/Eastern t/gmtime_test | bzip2 -9 > t/gmtime_test.out.bz2
bzdiff -u t/gmtime_test.out.bz2 t/gmtime.out.bz2 | less -F
TZ=Canada/Eastern t/localtime_test | bzip2 -9 > t/eastern_test.out.bz2
bzdiff -u t/eastern_test.out.bz2 t/eastern.out.bz2 | less -F
TZ=Australia/West t/localtime_test | bzip2 -9 > t/oz_test.out.bz2
bzdiff -u t/oz_test.out.bz2 t/oztime.out.bz2 | less -F
tap_tests: t/year_limit.t t/negative.t t/overflow.t t/timegm.t t/safe_year.t t/gmtime64.t
@which prove > /dev/null || (echo 'You need prove (from the Test::Harness perl module) to run these tests'; exit 1)
@prove --exec '' t/*.t
clean:
-rm t/year_limit.t \
t/negative.t \
t/timegm.t \
t/overflow.t \
t/safe_year.t \
t/localtime_test \
t/gmtime_test \
t/*_test.out.bz2 \
t/bench \
*.o