aboutsummaryrefslogtreecommitdiff
path: root/tests2/Makefile
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2012-12-14 17:18:03 +0100
committerAkim Demaille <akim@lrde.epita.fr>2012-12-18 10:06:20 +0100
commit3f09b90d211a86c1d002a786a5ffc34b72fba780 (patch)
tree83cf6a8b7031af509712a70ff92f69a4366e0861 /tests2/Makefile
parentd815896d4c07acbf12ca4b57b2ad530d85147de4 (diff)
downloadtinycc-3f09b90d211a86c1d002a786a5ffc34b72fba780.tar.gz
tinycc-3f09b90d211a86c1d002a786a5ffc34b72fba780.tar.bz2
build: fix VPATH builds
* configure (fn_dirname): New. Use it to ensure the creation of proper symlinks to Makefiles. (config.mak): Define top_builddir and top_srcdir. (CPPFLAGS): Be sure to find the headers. * Makefile, lib/Makefile, tests/Makefile, tests2/Makefile: Adjust to set VPATH properly. Fix confusion between top_builddir and top_srcdir.
Diffstat (limited to 'tests2/Makefile')
-rw-r--r--tests2/Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests2/Makefile b/tests2/Makefile
index b6833bd..d328ce7 100644
--- a/tests2/Makefile
+++ b/tests2/Makefile
@@ -1,5 +1,6 @@
TOP = ..
include $(TOP)/Makefile
+VPATH = $(top_srcdir)/tests2
ifeq ($(TARGETOS),Darwin)
CFLAGS+=-Wl,-flat_namespace,-undefined,warning
@@ -77,15 +78,15 @@ ifdef CONFIG_WIN32
TESTS := $(filter-out 28_strings.test,$(TESTS))
endif
-%.test: %.expect %.c
+%.test: %.c %.expect
@echo Test: $*...
@if [ "x`echo $* | grep args`" != "x" ]; \
then \
- ../tcc -B.. $(TCCFLAGS) -run $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
+ ../tcc -B.. $(TCCFLAGS) -run $< - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
else \
- ../tcc -B.. $(TCCFLAGS) -run $*.c 2>&1 >$*.output; \
+ ../tcc -B.. $(TCCFLAGS) -run $< 2>&1 >$*.output; \
fi
- @if diff -bu $*.expect $*.output ; \
+ @if diff -bu $(<:.c=.expect) $*.output ; \
then \
rm -f $*.output \
else \