2 # credits: 01..13.c from the pcc cpp-tests suite
6 include $(TOP
)/Makefile
7 SRC
= $(TOPSRC
)/tests
/pp
10 files
= $(patsubst %.
$1,%.
test,$(notdir $(wildcard $(SRC
)/*.
$1)))
11 TESTS
= $(call files
,c
) $(call files
,S
)
13 all test : $(sort $(TESTS
))
15 DIFF_OPTS
= -Nu
-b
-B
-I
"^\#"
17 # Filter source directory in warnings/errors (out-of-tree builds)
18 FILTER
= 2>&1 | sed
's,$(SRC)/,,g'
22 -@
$(TCC
) -E
-P
$< $(FILTER
) >$*.output
2>&1 ; \
23 diff
$(DIFF_OPTS
) $(SRC
)/$*.expect
$*.output \
28 -@
$(TCC
) -E
-P
$< $(FILTER
) >$*.output
2>&1 ; \
29 diff
$(DIFF_OPTS
) $(SRC
)/$*.expect
$*.output \
32 # automatically generate .expect files with gcc:
34 gcc
-E
-P
$*.
[cS
] >$*.expect
2>&1
36 # tell make not to delete
42 02.
test : DIFF_OPTS
+= -w
43 15.
test : DIFF_OPTS
+= -I
"^XXX:"
46 # -b ighore space changes
47 # -w ighore all whitespace
48 # -B ignore blank lines
49 # -I <RE> ignore lines matching RE