History

Improve cygwin Makefile that now support TARGET=32/64 to force final version for 32/64 platform

Christian Jullien committed 9 years ago

Commit 5550e431 parent 43d9a7d2 files · +30 −11Browse files

Unified · Split

2 files
  1. win32/Makefile +20 −11
  2. win32/tcc-win32.txt +10 −0
win32/Makefile+20−11
@@ -19,6 +19,16 @@ NATIVE = -m$(ARCH) -DTCC_TARGET_I386 · 18 unmodified lines
19PREFIX = i38619PREFIX = i386
20endif20endif
21 21
22TARGET = $(ARCH)
23
24ifeq ($(TARGET), 64)
25TFLAGS = -m$(TARGET) -DTCC_TARGET_X86_64
26TPREFIX = x86_64
27else
28TFLAGS = -m$(TARGET) -DTCC_TARGET_I386
29TPREFIX = i386
30endif
31
22all: pre bootstrap libs rebuild32all: pre bootstrap libs rebuild
23 @chmod 775 *.exe33 @chmod 775 *.exe
24 @ls -ls *.exe34 @ls -ls *.exe
@@ -70,7 +80,7 @@ lib/32/libtcc1.a: tiny_libmaker32.exe · 45 unmodified lines
70 @./tiny_libmaker32 lib/32/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o80 @./tiny_libmaker32 lib/32/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
71 @rm *.o81 @rm *.o
72 82
73lib/64/libtcc1.a: tcc.exe tiny_libmaker64.exe83lib/64/libtcc1.a: tiny_libmaker64.exe
74 @echo Building $*.a with tcc -m6484 @echo Building $*.a with tcc -m64
75 @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c 85 @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c
76 @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S 86 @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S
@@ -88,14 +98,14 @@ libs: lib/32/libtcc1.a lib/64/libtcc1.a · 11 unmodified lines
88PHONY += libs98PHONY += libs
89 99
90rebuild:100rebuild:
91 @echo Rebuild using tcc itself - default $(ARCH)bits101 @echo Rebuild using tcc itself - default $(TARGET)bits
92 @./$(PREFIX)-win32-tcc $(NATIVE) -DTCC_TARGET_PE -DONE_SOURCE -o tcc.exe ../tcc.c libtcc.dll102 @./$(TPREFIX)-win32-tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -o tcc.exe ../tcc.c
93 @./$(PREFIX)-win32-tcc $(NATIVE) -DTCC_TARGET_PE -DONE_SOURCE -o tiny_libmaker.exe tools/tiny_libmaker.c103 @./$(TPREFIX)-win32-tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -o tiny_libmaker.exe tools/tiny_libmaker.c
94 @./tcc $(NATIVE) -DTCC_TARGET_PE -DONE_SOURCE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c104 @./tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c
95 @./tcc -m$(ARCH) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_I386 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe i386-win32-tcc.exe105 @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_I386 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe i386-win32-tcc.exe
96 @./tcc -m$(ARCH) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_X86_64 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe x86_64-win32-tcc.exe106 @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_X86_64 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe x86_64-win32-tcc.exe
97 @./tcc -m$(ARCH) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_I386 -o tiny_libmaker32.exe tools/tiny_libmaker.c107 @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_I386 -o tiny_libmaker32.exe tools/tiny_libmaker.c
98 @./tcc -m$(ARCH) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_X86_64 -o tiny_libmaker64.exe tools/tiny_libmaker.c108 @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_X86_64 -o tiny_libmaker64.exe tools/tiny_libmaker.c
99 109
100PHONY += rebuild110PHONY += rebuild
101 111
@@ -110,7 +120,6 @@ tarball: · 8 unmodified lines
110 @cp -r lib $(TARNAME)120 @cp -r lib $(TARNAME)
111 @cp -r libtcc $(TARNAME)121 @cp -r libtcc $(TARNAME)
112 @cp -r tools $(TARNAME)122 @cp -r tools $(TARNAME)
113# @cp -r vs2015 $(TARNAME)
114 @cp -r build-tcc.bat $(TARNAME)123 @cp -r build-tcc.bat $(TARNAME)
115 @cp -r i386-win32-tcc.exe $(TARNAME)124 @cp -r i386-win32-tcc.exe $(TARNAME)
116 @cp -r libtcc.def $(TARNAME)125 @cp -r libtcc.def $(TARNAME)
@@ -128,4 +137,4 @@ tarball: · 11 unmodified lines
128PHONY += tarball137PHONY += tarball
129 138
130clean:139clean:
131 rm -f *.o *.exe *.dll lib/*/*.a140 rm -f *.o *.exe *.dll lib/*/*.a *.pdb *.obj *.exp *.def *.lib
win32/tcc-win32.txt+10−0
@@ -128,6 +128,16 @@ · 127 unmodified lines
128 Also you can copy/install everything into another directory:128 Also you can copy/install everything into another directory:
129 > build-tcc.bat -i <dir>129 > build-tcc.bat -i <dir>
130 130
131 * You can also bootstrap a native tcc Windows toolchain with cygwin.
132 https://www.cygwin.com/
133
134 Install Base, gcc, make
135 Launch Cygwin Terminal
136 > make
137 or to force 32bit executables (including 64bit backend)
138 > make TARGET=32
139 or to force 64bit executables (including 32bit backend)
140 > make TARGET=64
131 141
132 Limitations:142 Limitations:
133 ------------143 ------------

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t