2 # credits: 01..13.c from the pcc cpp-tests suite
6 include $(TOP
)/config.mak
7 SRC
= $(TOPSRC
)/tests
/pp
11 files
= $(patsubst %.
$1,%.
test,$(notdir $(wildcard $(SRC
)/*.
$1)))
12 TESTS
= $(call files
,c
) $(call files
,S
)
14 all test : $(sort $(TESTS
))
16 DIFF_OPTS
= -Nu
-b
-B
-I
"^\#"
18 # Filter source directory in warnings/errors (out-of-tree builds)
19 FILTER
= 2>&1 | sed
's,$(SRC)/,,g'
23 -@
$(TCC
) -E
-P
$< $(FILTER
) >$*.output
2>&1 ; \
24 diff
$(DIFF_OPTS
) $(SRC
)/$*.expect
$*.output \
29 -@
$(TCC
) -E
-P
$< $(FILTER
) >$*.output
2>&1 ; \
30 diff
$(DIFF_OPTS
) $(SRC
)/$*.expect
$*.output \
33 # automatically generate .expect files with gcc:
35 gcc
-E
-P
$< >$*.expect
2>&1
38 gcc
-E
-P
$< >$*.expect
2>&1
40 # tell make not to delete
46 02.
test : DIFF_OPTS
+= -w
47 15.
test : DIFF_OPTS
+= -I
"^XXX:"
50 # -b ighore space changes
51 # -w ighore all whitespace
52 # -B ignore blank lines
53 # -I <RE> ignore lines matching RE