aboutsummaryrefslogtreecommitdiff
path: root/tests/pp
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-01 21:06:53 +0200
committergrischka <grischka>2016-10-01 21:06:53 +0200
commitafdbc5b8152debb2ef053720b95f37a4cf4106eb (patch)
tree3e9b1d365027f9f3dc674729664d9d175d21fab2 /tests/pp
parent0a624782dfc8fee6f0600066b135d3b20e4274f4 (diff)
downloadtinycc-afdbc5b8152debb2ef053720b95f37a4cf4106eb.tar.gz
tinycc-afdbc5b8152debb2ef053720b95f37a4cf4106eb.tar.bz2
build: restore out-of-tree support
Diffstat (limited to 'tests/pp')
-rw-r--r--tests/pp/Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/pp/Makefile b/tests/pp/Makefile
index d687aca..3968481 100644
--- a/tests/pp/Makefile
+++ b/tests/pp/Makefile
@@ -2,8 +2,13 @@
# credits: 01..13.c from the pcc cpp-tests suite
#
+TOP = ../..
+include $(TOP)/config.mak
+SRC = $(TOPSRC)/tests/pp
+VPATH = $(SRC)
+
TCC = ../../tcc
-files = $(patsubst %.$1,%.test,$(wildcard *.$1))
+files = $(patsubst %.$1,%.test,$(notdir $(wildcard $(SRC)/*.$1)))
TESTS = $(call files,c) $(call files,S)
all test : $(sort $(TESTS))
@@ -13,13 +18,13 @@ DIFF_OPTS = -Nu -b -B -I "^\#"
%.test: %.c %.expect
@echo PPTest $* ...
-@$(TCC) -E -P $< >$*.output 2>&1 ; \
- diff $(DIFF_OPTS) $*.expect $*.output \
+ diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \
&& rm -f $*.output
%.test: %.S %.expect
@echo PPTest $* ...
-@$(TCC) -E -P $< >$*.output 2>&1 ; \
- diff $(DIFF_OPTS) $*.expect $*.output \
+ diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \
&& rm -f $*.output
# automatically generate .expect files with gcc: