Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6429 | siemargl | 1 | # |
2 | # credits: 01..13.c from the pcc cpp-tests suite |
||
3 | # |
||
4 | |||
5 | TCC = ../../tcc |
||
6 | TESTS = $(patsubst %.c,%.test,$(wildcard *.c)) |
||
7 | TESTS += $(patsubst %.S,%.test,$(wildcard *.S)) |
||
8 | |||
9 | all test : $(TESTS) |
||
10 | |||
11 | %.test: %.c %.expect |
||
12 | @echo PPTest $* ... |
||
13 | @$(TCC) -E -P $< >$*.output 2>&1 ; \ |
||
14 | diff -Nu -b -B -I "^#" $(EXTRA_DIFF_OPTS) $*.expect $*.output \ |
||
15 | && rm -f $*.output |
||
16 | |||
17 | %.test: %.S %.expect |
||
18 | @echo PPTest $* ... |
||
19 | @$(TCC) -E -P $< >$*.output 2>&1 ; \ |
||
20 | diff -Nu -b -B -I "^#" $(EXTRA_DIFF_OPTS) $*.expect $*.output \ |
||
21 | && rm -f $*.output |
||
22 | |||
23 | # automatically generate .expect files with gcc: |
||
24 | %.expect: %.c |
||
25 | gcc -E -P $*.c >$*.expect 2>&1 |
||
26 | |||
27 | %.expect: %.S |
||
28 | gcc -E -P $*.S >$*.expect 2>&1 |
||
29 | |||
30 | # tell make not to delete |
||
31 | .PRECIOUS: %.expect |
||
32 | |||
33 | clean: |
||
34 | rm -vf *.output |
||
35 | |||
36 | # 02.test : EXTRA_DIFF_OPTS = -w |
||
37 | # 03.test : EXTRA_DIFF_OPTS = -w |
||
38 | # 04.test : EXTRA_DIFF_OPTS = -w |
||
39 | # 10.test : EXTRA_DIFF_OPTS = -w |
||
40 | |||
41 | # diff options: |
||
42 | # -b ighore space changes |
||
43 | # -w ighore all whitespace |
||
44 | # -B ignore blank lines |
||
45 | # -I |