aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/Makefile b/tests/Makefile
index b958a48..62e4f88 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -16,6 +16,9 @@ TESTS = \
abitest \
vla_test-run \
moretests
+ifdef CONFIG_CROSS
+TESTS += hello-cross
+endif
# test4 -- problem with -static
# asmtest -- minor differences with gcc
@@ -50,8 +53,9 @@ endif
# run local version of tcc with local libraries and includes
TCCFLAGS = -B$(TOP) -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include
ifdef CONFIG_WIN32
- TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir) -I$(top_srcdir)/include -I$(TOP) -L$(TOP)
+ TCCFLAGS = -B$(top_srcdir)/win32 --I$(top_srcdir) -I$(top_srcdir)/include -I$(TOP) -L$(TOP)
endif
+XTCCFLAGS = -B$(TOP) -B$(top_srcdir)/win32 -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include
TCC = $(TOP)/tcc $(TCCFLAGS)
RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(top_srcdir)/tcc.c $(TCCFLAGS)
@@ -69,6 +73,15 @@ hello-exe: ../examples/ex1.c
@echo ------------ $@ ------------
$(TCC) $< -o hello$(EXESUF) || ($(TOP)/tcc -vv; exit 1) && ./hello$(EXESUF)
+hello-cross: ../examples/ex1.c
+ @echo ------------ $@ ------------
+ for XTCC in $(PROGS_CROSS) ; \
+ do echo -n "Test of $$XTCC... "; \
+ out=$$($(TOP)/$$XTCC $(XTCCFLAGS) -c $< 2>&1); \
+ test $$? -ne 0 && { echo "Failed\n$$out\n" ; $(TOP)/$$XTCC -vv; exit 1; } ; \
+ echo "Success"; \
+ done
+
hello-run: ../examples/ex1.c
@echo ------------ $@ ------------
$(TCC) -run $<