-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
144 lines (103 loc) · 2.38 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.PHONY: all check clean install
all: thue
check: \
tmp/no-such-file \
tmp/help1.log \
tmp/help2.log \
tmp/version1.log \
tmp/version2.log \
tmp/hello.log \
tmp/seq.log \
tmp/io.log \
tmp/io-l.log \
tmp/io-r.log \
tmp/incr.log \
tmp/yes.log \
tmp/quine.log \
tmp/quine2.log \
tmp/quine3.log \
tmp/bin1.log \
tmp/bin2.log
clean:
-rm -rf tmp
-rm thue
install:
install -d $(out)/bin
install thue $(out)/bin/
thue: thue.cc
$(CXX) -Wall -W -O3 -std=c++17 -o $@ $<
tmp:
install -d $@
tmp/h: thue | tmp
./thue -h > $@
tmp/no-such-file: thue | tmp
! ./thue no-such-file 2> $@
tmp/help1: thue | tmp
./thue -h > $@
tmp/help1.log: tmp/h tmp/help1
diff -u $^ > $@
tmp/help2: thue | tmp
./thue --help > $@
tmp/help2.log: tmp/h tmp/help2
diff -u $^ > $@
tmp/version1: thue | tmp
./thue -V > $@
tmp/version1.log: VERSION tmp/version1
diff -u $^ > $@
tmp/version2: thue | tmp
./thue --version > $@
tmp/version2.log: VERSION tmp/version2
diff -u $^ > $@
tmp/hello: test/hello.t thue | tmp
./thue $< > $@
tmp/hello.log: test/hello.txt tmp/hello
diff -u $^ > $@
tmp/seq: test/seq.t thue | tmp
./thue -s 15000 test/seq.t > $@
tmp/seq.log: test/seq.txt tmp/seq
diff -u $^ > $@
tmp/io: test/io.t thue | tmp
./thue $< < $< > $@
tmp/io.log: test/io.txt tmp/io
diff -u $^ > $@
tmp/io-l: test/io.t thue | tmp
./thue -l $< < $< > $@
tmp/io-l.log: test/io.txt tmp/io-l
diff -u $^ > $@
tmp/io-r: test/io.t thue | tmp
./thue -r $< < $< > $@
tmp/io-r.log: test/io.txt tmp/io-r
diff -u $^ > $@
tmp/incr: test/incr.t | tmp
echo 0 | ./thue $< > tmp/incr
echo 1 | ./thue $< >> tmp/incr
echo 10 | ./thue $< >> tmp/incr
echo 11 | ./thue $< >> tmp/incr
tmp/incr.log: test/incr.txt tmp/incr
diff -u $^ > $@
tmp/yes: test/yes.t | tmp
./thue -s 42 $< > $@
tmp/yes.log: test/yes.txt tmp/yes
diff -u $^ > $@
tmp/quine: test/quine.t | tmp
./thue $< > $@
tmp/quine.log: test/quine.t tmp/quine
diff -u $^ > $@
tmp/quine2: test/quine2.t | tmp
./thue $< > $@
tmp/quine2.log: test/quine2.t tmp/quine2
diff -u $^ > $@
tmp/quine3: test/quine3.t | tmp
./thue $< > $@
tmp/quine3.log: test/quine3.t tmp/quine3
diff -u $^ > $@
tmp/bin1a: test/bin.t thue | tmp
./thue -S 1 $< > $@
tmp/bin1b: test/bin.t thue | tmp
./thue -S 1 $< > $@
tmp/bin2: test/bin.t thue | tmp
./thue -S 2 $< > $@
tmp/bin1.log: tmp/bin1a tmp/bin1b
diff -u $^ > $@
tmp/bin2.log: tmp/bin1a tmp/bin2
! diff -u $^ > $@