Unified · Split
| @@ -10,7 +10,7 @@ CPU = $(shell if `gcc -v 2>&1 | grep Target | grep -q x86_64`; then echo 64; els · 9 unmodified lines | ||
| 10 | 10 | VERSION = $(shell cat ../VERSION) |
| 11 | 11 | BOOTCC = gcc |
| 12 | 12 | CFLAGS = -s -static -fno-strict-aliasing -Wno-incompatible-pointer-types -DTCC_TARGET_PE |
| 13 | −WINPWD = `cygpath --mixed $(PWD)` | |
| 13 | +#WINPWD = `cygpath --mixed $(PWD)` | |
| 14 | 14 | |
| 15 | 15 | ifeq ($(CPU), 64) |
| 16 | 16 | NATIVE = -m$(CPU) -DTCC_TARGET_X86_64 |
| @@ -40,7 +40,7 @@ pre: · 23 unmodified lines | ||
| 40 | 40 | @echo CONFIG_WIN32=yes 1>> ../config.mak |
| 41 | 41 | @echo TOPSRC=$$\(TOP\) 1>> ../config.mak |
| 42 | 42 | @echo "#define TCC_VERSION \"$(VERSION)\"" 1>../config.h |
| 43 | − @echo "#define CONFIG_TCCDIR \"$(WINPWD)\"" 1>>../config.h | |
| 43 | + #@echo "#define CONFIG_TCCDIR \"$(WINPWD)\"" 1>>../config.h | |
| 44 | 44 | @echo "#ifdef TCC_TARGET_X86_64" 1>>../config.h |
| 45 | 45 | @echo "#define TCC_LIBTCC1 \"libtcc1-64.a\"" 1>>../config.h |
| 46 | 46 | @echo "#else" 1>>../config.h |
| @@ -70,31 +70,31 @@ PHONY += bootstrap · 23 unmodified lines | ||
| 70 | 70 | |
| 71 | 71 | lib/libtcc1-32.a: |
| 72 | 72 | @echo Building $*.a with tcc -m32 |
| 73 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/libtcc1.c | |
| 74 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86.S | |
| 75 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86-bt.S | |
| 76 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1.c | |
| 77 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1w.c | |
| 78 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1.c | |
| 79 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1w.c | |
| 80 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllcrt1.c | |
| 81 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllmain.c | |
| 82 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/chkstk.S | |
| 73 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/libtcc1.c | |
| 74 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86.S | |
| 75 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86-bt.S | |
| 76 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1.c | |
| 77 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1w.c | |
| 78 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1.c | |
| 79 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1w.c | |
| 80 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllcrt1.c | |
| 81 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllmain.c | |
| 82 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/chkstk.S | |
| 83 | 83 | @./tcc -m32 -ar lib/libtcc1-32.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o crt1w.o wincrt1w.o dllcrt1.o dllmain.o chkstk.o |
| 84 | 84 | @rm *.o |
| 85 | 85 | |
| 86 | 86 | lib/libtcc1-64.a: |
| 87 | 87 | @echo Building $*.a with tcc -m64 |
| 88 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c | |
| 89 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S | |
| 90 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64-bt.S | |
| 91 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1.c | |
| 92 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1w.c | |
| 93 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1.c | |
| 94 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1w.c | |
| 95 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllcrt1.c | |
| 96 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllmain.c | |
| 97 | − @./tcc -O2 -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/chkstk.S | |
| 88 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c | |
| 89 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S | |
| 90 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64-bt.S | |
| 91 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1.c | |
| 92 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1w.c | |
| 93 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1.c | |
| 94 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1w.c | |
| 95 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllcrt1.c | |
| 96 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllmain.c | |
| 97 | + @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/chkstk.S | |
| 98 | 98 | @./tcc -m64 -ar lib/libtcc1-64.a libtcc1.o alloca86_64.o alloca86_64-bt.o crt1.o wincrt1.o crt1w.o wincrt1w.o dllcrt1.o dllmain.o chkstk.o |
| 99 | 99 | @rm *.o |
| 100 | 100 | |
| @@ -104,10 +104,10 @@ PHONY += libs · 3 unmodified lines | ||
| 104 | 104 | |
| 105 | 105 | rebuild: |
| 106 | 106 | @echo Rebuild using tcc itself - default $(TARGET)bits |
| 107 | − @./$(TARCH)-win32-tcc -O2 $(TFLAGS) -DTCC_TARGET_PE -o tcc.exe ../tcc.c | |
| 108 | − @./tcc -O2 $(TFLAGS) -DTCC_TARGET_PE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c | |
| 109 | − @./tcc -O2 -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe i386-win32-tcc.exe | |
| 110 | − @./tcc -O2 -m$(TARGET) -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe x86_64-win32-tcc.exe | |
| 107 | + @./$(TARCH)-win32-tcc -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -o tcc.exe ../tcc.c | |
| 108 | + @./tcc -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c | |
| 109 | + @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe i386-win32-tcc.exe | |
| 110 | + @./tcc -O2 -B. -m$(TARGET) -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe x86_64-win32-tcc.exe | |
| 111 | 111 | |
| 112 | 112 | PHONY += rebuild |
| 113 | 113 | |