all : tcclibs tcctest tcctest.exe tcctest : tcctest.c $(CC) -o $@ $^ -lm -Wl,-rpath,. tcc-$(shell uname -s)-$(shell uname -m).so -s -Os -Itinycc tcctest.exe : tcctest.c x86_64-w64-mingw32-gcc -Itinycc -o $@ $^ -lm tcc-Windows-64.dll -s -Os -Itinycc LICFLAGS:=-Itinycc -I. -shared -Os TCC:=tinycc/libtcc.c tinycc/tccpp.c tinycc/tccasm.c tinycc/tccgen.c tinycc/tccrun.c .PHONY : tcclibs tcclibs : tcc-Linux-i386.so tcc-Linux-x86_64.so tcc-Windows-32.dll tcc-Windows-64.dll tcc-Linux-i386.so : gcc $(LICFLAGS) -fPIC $(TCC) tinycc/tccelf.c tinycc/i386-link.c tinycc/i386-asm.c tinycc/i386-gen.c -DTCC_TARGET_I386 -m32 -march=i386 -o tcc-Linux-i386.so $^ -ldl -s tcc-Linux-x86_64.so : gcc $(LICFLAGS) -fPIC $(TCC) tinycc/tccelf.c tinycc/x86_64-link.c tinycc/i386-asm.c tinycc/x86_64-gen.c -DTCC_TARGET_X86_64 -m64 -o tcc-Linux-x86_64.so $^ -ldl -s tcc-Windows-32.dll : i686-w64-mingw32-gcc $(LICFLAGS) $(TCC) tinycc/tccpe.c tinycc/i386-link.c tinycc/i386-asm.c tinycc/i386-gen.c tinycc/tccelf.c -DTCC_TARGET_PE -DTCC_TARGET_I386 -o tcc-Windows-32.dll $^ -lm -s tcc-Windows-64.dll : x86_64-w64-mingw32-gcc $(LICFLAGS) $(TCC) tinycc/tccpe.c tinycc/x86_64-link.c tinycc/i386-asm.c tinycc/x86_64-gen.c tinycc/tccelf.c -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -o tcc-Windows-64.dll $^ -lm -s gettcc : git clone --depth=1 git://repo.or.cz/tinycc.git $(shell echo -ne "#ifndef CONFIG_TCCDIR\n#define TCC_IS_NATIVE\n# define CONFIG_TCCDIR \"tinycc\"\n#endif\n#define GCC_MAJOR 5\n#define GCC_MINOR 4\n#define TCC_VERSION \"0.9.27\"\n#define STATIC_TCC" > tinycc/config.h) clean : rm -rf tcctest tcctest.exe tcc-Windows-32.dll tcc-Windows-64.dll tcc-Linux-i386.so tcc-Linux-x86_64.so