diff options
| author | grischka <grischka> | 2017-02-25 12:49:47 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2017-02-25 12:51:04 +0100 |
| commit | bb93064d7857d887b674999c9b4152b44a628f9a (patch) | |
| tree | 5290a93161373fd5a286d9aaf32ebb8dea04f82c /tests/Makefile | |
| parent | 669f61117d6ff2255649e80a9708fe24e32d4a33 (diff) | |
| download | tinycc-bb93064d7857d887b674999c9b4152b44a628f9a.tar.gz tinycc-bb93064d7857d887b674999c9b4152b44a628f9a.tar.bz2 | |
makefile: unify cross with native builds
supports building cross compilers on the fly without need
for configure --enable-cross
$ make cross # all compilers
$ make cross-TARGET # only TARGET-compiler & its libtcc1.a
with TARGET one from
i386 x86_64 i386-win32 x86_64-win32 arm arm64 arm-wince c67
Type 'make help' for more information
Diffstat (limited to 'tests/Makefile')
| -rw-r--r-- | tests/Makefile | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/Makefile b/tests/Makefile index 558d06c..fdd57b2 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -17,6 +17,7 @@ TESTS = \ dlltest \ abitest \ vla_test-run \ + cross-test \ tests2-dir \ pp-dir @@ -45,23 +46,22 @@ endif ifeq (,$(filter i386 x86_64,$(ARCH))) TESTS := $(filter-out dlltest,$(TESTS)) endif +ifndef CONFIG_CROSS + TESTS := $(filter-out cross-%,$(TESTS)) +endif -# run local version of tcc with local libraries and includes -TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) ifdef CONFIG_WIN32 - TCCFLAGS = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) -L$(TOP) - PATH := $(CURDIR)/$(TOP):$(PATH) # for libtcc_test to find libtcc.dll + PATH := $(CURDIR)/$(TOP);$(PATH) # for libtcc_test to find libtcc.dll endif -TCC = $(TOP)/tcc $(TCCFLAGS) -RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(TOPSRC)/tcc.c $(TCCFLAGS) - ifeq ($(TARGETOS),Darwin) CFLAGS += -Wl,-flat_namespace,-undefined,warning TCCFLAGS += -D_ANSI_SOURCE export MACOSX_DEPLOYMENT_TARGET:=10.2 endif +RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(TOPSRC)/tcc.c $(TCCFLAGS) + DISAS = objdump -d all test : clean-s $(TESTS) @@ -236,6 +236,16 @@ vla_test-run: vla_test$(EXESUF) @echo ------------ $@ ------------ ./vla_test$(EXESUF) +cross-test : + @echo ------------ $@ ------------ + $(TOP)/i386-tcc$(EXESUF) $(TCCFLAGS-unx) -c $(TOPSRC)/examples/ex3.c && echo "ok" + $(TOP)/x86_64-tcc$(EXESUF) $(TCCFLAGS-unx) -c $(TOPSRC)/examples/ex3.c && echo "ok" + $(TOP)/arm-tcc$(EXESUF) $(TCCFLAGS-unx) -c $(TOPSRC)/examples/ex3.c && echo "ok" + $(TOP)/c67-tcc$(EXESUF) $(TCCFLAGS-unx) -c $(TOPSRC)/examples/ex3.c && echo "ok" + $(TOP)/i386-win32-tcc$(EXESUF) $(TCCFLAGS-win) $(TOPSRC)/win32/examples/hello_win.c && echo "ok" + $(TOP)/x86_64-win32-tcc$(EXESUF) $(TCCFLAGS-win) $(TOPSRC)/win32/examples/hello_win.c && echo "ok" + $(TOP)/arm-wince-tcc$(EXESUF) $(TCCFLAGS-win) -c $(TOPSRC)/win32/examples/hello_win.c && echo "ok" + # targets for development %.bin: %.c tcc $(TCC) -g -o $@ $< |
