diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2014-01-09 17:15:08 +0800 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2014-01-09 17:15:08 +0800 |
| commit | 767410b8750b45d63805b45ca1a2cf34d7cb4923 (patch) | |
| tree | 38a3aa05db2104775505c579e23e081316cedfaa /tests/Makefile | |
| parent | da0601e49076d97681e9f3107f563339bf718d6a (diff) | |
| download | tinycc-767410b8750b45d63805b45ca1a2cf34d7cb4923.tar.gz tinycc-767410b8750b45d63805b45ca1a2cf34d7cb4923.tar.bz2 | |
Various Makefile fixes for cross-compilation
- Build libtcc1 for cross-compiler on arm (arm to X cross compilers)
- Install libtcc1 and includes for arm to i386 cross compiler
- Add basic check of cross-compilers (compile ex1.c)
Diffstat (limited to 'tests/Makefile')
| -rw-r--r-- | tests/Makefile | 15 |
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 $< |
