build: revert Makefiles to 0.9.26 state (mostly)
[tinycc.git] / tests / pp / Makefile
blobd687acab4d872a1803bcab7a871d4539d1f71095
2 # credits: 01..13.c from the pcc cpp-tests suite
5 TCC = ../../tcc
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 "^\#"
13 %.test: %.c %.expect
14 @echo PPTest $* ...
15 -@$(TCC) -E -P $< >$*.output 2>&1 ; \
16 diff $(DIFF_OPTS) $*.expect $*.output \
17 && rm -f $*.output
19 %.test: %.S %.expect
20 @echo PPTest $* ...
21 -@$(TCC) -E -P $< >$*.output 2>&1 ; \
22 diff $(DIFF_OPTS) $*.expect $*.output \
23 && rm -f $*.output
25 # automatically generate .expect files with gcc:
26 %.expect: %.c
27 gcc -E -P $< >$*.expect 2>&1
29 %.expect: %.S
30 gcc -E -P $< >$*.expect 2>&1
32 # tell make not to delete
33 .PRECIOUS: %.expect
35 clean:
36 rm -vf *.output
38 # 02.test : DIFF_OPTS += -w
39 # 15.test : DIFF_OPTS += -w
41 # diff options:
42 # -b ighore space changes
43 # -w ighore all whitespace
44 # -B ignore blank lines
45 # -I <RE> ignore lines matching RE