2 # credits: 01..13.c from the pcc cpp-tests suite
6 files
= $(patsubst %.
$1,%.
test,$(wildcard *.
$1))
7 TESTS
= $(call files
,c
) $(call files
,S
)
9 all test : $(sort $(TESTS
))
11 DIFF_OPTS
= -Nu
-b
-B
-I
"^\#"
15 -@
$(TCC
) -E
-P
$< >$*.output
2>&1 ; \
16 diff
$(DIFF_OPTS
) $*.expect
$*.output \
21 -@
$(TCC
) -E
-P
$< >$*.output
2>&1 ; \
22 diff
$(DIFF_OPTS
) $*.expect
$*.output \
25 # automatically generate .expect files with gcc:
27 gcc
-E
-P
$< >$*.expect
2>&1
30 gcc
-E
-P
$< >$*.expect
2>&1
32 # tell make not to delete
38 # 02.test : DIFF_OPTS += -w
39 # 15.test : DIFF_OPTS += -w
42 # -b ighore space changes
43 # -w ighore all whitespace
44 # -B ignore blank lines
45 # -I <RE> ignore lines matching RE