History

tiny_impldef.exe was not built by Makefile

Christian Jullien committed 9 years ago

Commit d61985b1 parent 7b99c3a1 file · +142 −140Browse files

Unified · Split

win32/Makefile+142−140
@@ -1,140 +1,142 @@
1−#
2−# This Makefile builds native Windows tcc for both 32 and 64 bits generator.
3−# It requires Cygwin 64 and gcc to bootstrap a first tcc version which is used
4−# by a second stage to compile tcc it self.
5−# Generated binaries do not require cygwin to run.
6−# You can launch 'tarball' target to build a tar.gz you can install on any
7−# Windows machines.
8−
9−ARCH = $(shell if `gcc -v 2>&1 | grep Target | grep -q x86_64`; then echo 64; else echo 32; fi)
10−VERSION = $(shell cat ../VERSION)
11−BOOTCC = gcc
12−CFLAGS = -s -fno-strict-aliasing -Wno-incompatible-pointer-types -DTCC_TARGET_PE -DONE_SOURCE
13−
14−ifeq ($(ARCH), 64)
15−NATIVE = -m$(ARCH) -DTCC_TARGET_X86_64
16−PREFIX = x86_64
17−else
18−NATIVE = -m$(ARCH) -DTCC_TARGET_I386
19−PREFIX = i386
20−endif
21−
22−TARGET = $(ARCH)
23−
24−ifeq ($(TARGET), 64)
25−TFLAGS = -m$(TARGET) -DTCC_TARGET_X86_64
26−TPREFIX = x86_64
27−else
28−TFLAGS = -m$(TARGET) -DTCC_TARGET_I386
29−TPREFIX = i386
30−endif
31−
32−all: pre bootstrap libs rebuild
33− @chmod 775 *.exe
34− @ls -ls *.exe
35−
36−pre:
37− @echo "#define TCC_VERSION \"$(VERSION)\"" 1>../config.h
38− @echo "#ifdef TCC_TARGET_X86_64" 1>>../config.h
39− @echo "#define CONFIG_TCC_LIBPATHS \"{B}/lib/64;{B}/lib\"" 1>>../config.h
40− @echo "#else" 1>>../config.h
41− @echo "#define CONFIG_TCC_LIBPATHS \"{B}/lib/32;{B}/lib\"" 1>>../config.h
42− @echo "#endif" 1>>../config.h
43− @echo @set VERSION $(VERSION) 1>../config.texi
44− @rm -f *tcc.exe tiny_*.exe *tcc.dll
45− @rm -r -f libtcc
46− @rm -r -f libtcc doc lib/32 lib/64
47− @mkdir libtcc
48− @mkdir doc
49− @mkdir lib/32
50− @mkdir lib/64
51− @cp ../include/*.h include
52− @cp ../tcclib.h include
53− @cp ../libtcc.h include
54− @cp tcc-win32.txt doc
55− @cp ../tests/libtcc_test.c examples
56−
57−PHONY += pre
58−
59−bootstrap:
60− @echo Bootstrapping 32bits and 64bits tools with $(BOOTCC) -m$(ARCH)
61− @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_I386 -o i386-win32-tcc.exe ../tcc.c
62− @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_I386 -o tiny_libmaker32.exe ./tools/tiny_libmaker.c
63− @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_X86_64 -o x86_64-win32-tcc.exe ../tcc.c
64− @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_X86_64 -o tiny_libmaker64.exe ./tools/tiny_libmaker.c
65− @$(BOOTCC) $(CFLAGS) $(NATIVE) -o tcc.exe ../tcc.c
66− @$(BOOTCC) $(CFLAGS) $(NATIVE) -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c
67−
68−PHONY += bootstrap
69−
70−lib/32/libtcc1.a: tiny_libmaker32.exe
71− @echo Building $*.a with tcc -m32
72− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/libtcc1.c
73− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86.S
74− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86-bt.S
75− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1.c
76− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1.c
77− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllcrt1.c
78− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllmain.c
79− @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/chkstk.S
80− @./tiny_libmaker32 lib/32/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
81− @rm *.o
82−
83−lib/64/libtcc1.a: tiny_libmaker64.exe
84− @echo Building $*.a with tcc -m64
85− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c
86− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S
87− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64-bt.S
88− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1.c
89− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1.c
90− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllcrt1.c
91− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllmain.c
92− @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/chkstk.S
93− @./tiny_libmaker64 lib/64/libtcc1.a libtcc1.o alloca86_64.o alloca86_64-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
94− @rm *.o
95−
96−libs: lib/32/libtcc1.a lib/64/libtcc1.a
97−
98−PHONY += libs
99−
100−rebuild:
101− @echo Rebuild using tcc itself - default $(TARGET)bits
102− @./$(TPREFIX)-win32-tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -o tcc.exe ../tcc.c
103− @./$(TPREFIX)-win32-tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -o tiny_libmaker.exe tools/tiny_libmaker.c
104− @./tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c
105− @./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
106− @./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
107− @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_I386 -o tiny_libmaker32.exe tools/tiny_libmaker.c
108− @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_X86_64 -o tiny_libmaker64.exe tools/tiny_libmaker.c
109−
110−PHONY += rebuild
111−
112−TARNAME = tcc-$(VERSION)-$(PREFIX)-win32
113−
114−tarball:
115− @rm -r -f $(TARNAME)
116− @mkdir $(TARNAME)
117− @cp -r doc $(TARNAME)
118− @cp -r examples $(TARNAME)
119− @cp -r include $(TARNAME)
120− @cp -r lib $(TARNAME)
121− @cp -r libtcc $(TARNAME)
122− @cp -r tools $(TARNAME)
123− @cp -r build-tcc.bat $(TARNAME)
124− @cp -r i386-win32-tcc.exe $(TARNAME)
125− @cp -r libtcc.def $(TARNAME)
126− @cp -r libtcc.dll $(TARNAME)
127− @cp -r Makefile $(TARNAME)
128− @cp -r tcc.exe $(TARNAME)
129− @cp -r tcc-win32.txt $(TARNAME)
130− @cp -r tiny_libmaker.exe $(TARNAME)
131− @cp -r tiny_libmaker32.exe $(TARNAME)
132− @cp -r tiny_libmaker64.exe $(TARNAME)
133− @cp -r x86_64-win32-tcc.exe $(TARNAME)
134− @tar czf $(TARNAME).tar.gz $(TARNAME)
135− @rm -r -f $(TARNAME)
136−
137−PHONY += tarball
138−
139−clean:
140− rm -f *.o *.exe *.dll lib/*/*.a *.pdb *.obj *.exp *.def *.lib
1+#
2+# This Makefile builds native Windows tcc for both 32 and 64 bits generator.
3+# It requires Cygwin 64 and gcc to bootstrap a first tcc version which is used
4+# by a second stage to compile tcc it self.
5+# Generated binaries do not require cygwin to run.
6+# You can launch 'tarball' target to build a tar.gz you can install on any
7+# Windows machines.
8+
9+ARCH = $(shell if `gcc -v 2>&1 | grep Target | grep -q x86_64`; then echo 64; else echo 32; fi)
10+VERSION = $(shell cat ../VERSION)
11+BOOTCC = gcc
12+CFLAGS = -s -fno-strict-aliasing -Wno-incompatible-pointer-types -DTCC_TARGET_PE -DONE_SOURCE
13+
14+ifeq ($(ARCH), 64)
15+NATIVE = -m$(ARCH) -DTCC_TARGET_X86_64
16+PREFIX = x86_64
17+else
18+NATIVE = -m$(ARCH) -DTCC_TARGET_I386
19+PREFIX = i386
20+endif
21+
22+TARGET = $(ARCH)
23+
24+ifeq ($(TARGET), 64)
25+TFLAGS = -m$(TARGET) -DTCC_TARGET_X86_64
26+TPREFIX = x86_64
27+else
28+TFLAGS = -m$(TARGET) -DTCC_TARGET_I386
29+TPREFIX = i386
30+endif
31+
32+all: pre bootstrap libs rebuild
33+ @chmod 775 *.exe
34+ @ls -ls *.exe
35+
36+pre:
37+ @echo "#define TCC_VERSION \"$(VERSION)\"" 1>../config.h
38+ @echo "#ifdef TCC_TARGET_X86_64" 1>>../config.h
39+ @echo "#define CONFIG_TCC_LIBPATHS \"{B}/lib/64;{B}/lib\"" 1>>../config.h
40+ @echo "#else" 1>>../config.h
41+ @echo "#define CONFIG_TCC_LIBPATHS \"{B}/lib/32;{B}/lib\"" 1>>../config.h
42+ @echo "#endif" 1>>../config.h
43+ @echo @set VERSION $(VERSION) 1>../config.texi
44+ @rm -f *tcc.exe tiny_*.exe *tcc.dll
45+ @rm -r -f libtcc
46+ @rm -r -f libtcc doc lib/32 lib/64
47+ @mkdir libtcc
48+ @mkdir doc
49+ @mkdir lib/32
50+ @mkdir lib/64
51+ @cp ../include/*.h include
52+ @cp ../tcclib.h include
53+ @cp ../libtcc.h include
54+ @cp tcc-win32.txt doc
55+ @cp ../tests/libtcc_test.c examples
56+
57+PHONY += pre
58+
59+bootstrap:
60+ @echo Bootstrapping 32bits and 64bits tools with $(BOOTCC) -m$(ARCH)
61+ @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_I386 -o i386-win32-tcc.exe ../tcc.c
62+ @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_I386 -o tiny_libmaker32.exe ./tools/tiny_libmaker.c
63+ @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_X86_64 -o x86_64-win32-tcc.exe ../tcc.c
64+ @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_X86_64 -o tiny_libmaker64.exe ./tools/tiny_libmaker.c
65+ @$(BOOTCC) $(CFLAGS) $(NATIVE) -o tcc.exe ../tcc.c
66+ @$(BOOTCC) $(CFLAGS) $(NATIVE) -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c
67+
68+PHONY += bootstrap
69+
70+lib/32/libtcc1.a: tiny_libmaker32.exe
71+ @echo Building $*.a with tcc -m32
72+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/libtcc1.c
73+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86.S
74+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86-bt.S
75+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1.c
76+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1.c
77+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllcrt1.c
78+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllmain.c
79+ @./tcc -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/chkstk.S
80+ @./tiny_libmaker32 lib/32/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
81+ @rm *.o
82+
83+lib/64/libtcc1.a: tiny_libmaker64.exe
84+ @echo Building $*.a with tcc -m64
85+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c
86+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S
87+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64-bt.S
88+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1.c
89+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1.c
90+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllcrt1.c
91+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllmain.c
92+ @./tcc -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/chkstk.S
93+ @./tiny_libmaker64 lib/64/libtcc1.a libtcc1.o alloca86_64.o alloca86_64-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
94+ @rm *.o
95+
96+libs: lib/32/libtcc1.a lib/64/libtcc1.a
97+
98+PHONY += libs
99+
100+rebuild:
101+ @echo Rebuild using tcc itself - default $(TARGET)bits
102+ @./$(TPREFIX)-win32-tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -o tcc.exe ../tcc.c
103+ @./$(TPREFIX)-win32-tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -o tiny_libmaker.exe tools/tiny_libmaker.c
104+ @./$(TPREFIX)-win32-tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -o tiny_impdef.exe tools/tiny_impdef.c
105+ @./tcc $(TFLAGS) -DTCC_TARGET_PE -DONE_SOURCE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c
106+ @./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
107+ @./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
108+ @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_I386 -o tiny_libmaker32.exe tools/tiny_libmaker.c
109+ @./tcc -m$(TARGET) -DTCC_TARGET_PE -DONE_SOURCE -DTCC_TARGET_X86_64 -o tiny_libmaker64.exe tools/tiny_libmaker.c
110+
111+PHONY += rebuild
112+
113+TARNAME = tcc-$(VERSION)-$(PREFIX)-win32
114+
115+tarball:
116+ @rm -r -f $(TARNAME)
117+ @mkdir $(TARNAME)
118+ @cp -r doc $(TARNAME)
119+ @cp -r examples $(TARNAME)
120+ @cp -r include $(TARNAME)
121+ @cp -r lib $(TARNAME)
122+ @cp -r libtcc $(TARNAME)
123+ @cp -r tools $(TARNAME)
124+ @cp -r build-tcc.bat $(TARNAME)
125+ @cp -r i386-win32-tcc.exe $(TARNAME)
126+ @cp -r libtcc.def $(TARNAME)
127+ @cp -r libtcc.dll $(TARNAME)
128+ @cp -r Makefile $(TARNAME)
129+ @cp -r tcc.exe $(TARNAME)
130+ @cp -r tcc-win32.txt $(TARNAME)
131+ @cp -r tiny_impdef.exe $(TARNAME)
132+ @cp -r tiny_libmaker.exe $(TARNAME)
133+ @cp -r tiny_libmaker32.exe $(TARNAME)
134+ @cp -r tiny_libmaker64.exe $(TARNAME)
135+ @cp -r x86_64-win32-tcc.exe $(TARNAME)
136+ @tar czf $(TARNAME).tar.gz $(TARNAME)
137+ @rm -r -f $(TARNAME)
138+
139+PHONY += tarball
140+
141+clean:
142+ rm -f *.o *.exe *.dll lib/*/*.a *.pdb *.obj *.exp *.def *.lib

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