History

remove wine

herman ten brugge committed 7 years ago

Commit c4c5ea41 parent b84ab231 file · +0 −156Browse files

Unified · Split

wine/Makefile+0−156
@@ -1,156 +0,0 @@
1#
2# This Makefile builds native Windows tcc for both 32 and 64 bits generator.
3# This makefile is adjusted from 'https://sourceforge.net/projects/wintcc/'
4# It requires mingw64 (and static libs for dl and pthread) and wine installed on linux.
5# by a second stage to compile tcc it self.
6# Generated binaries do not require cygwin to run.
7# You can launch 'tarball' target to build a tar.gz you can install on any
8# Windows machines.
9
10CPU = $(shell if `x86_64-w64-mingw32-gcc -v 2>&1 | grep Target | grep -q x86_64`; then echo 64; else echo 32; fi)
11VERSION = $(shell cat ../VERSION)
12BOOTCC = x86_64-w64-mingw32-gcc
13CFLAGS = -s -static -fno-strict-aliasing -Wno-incompatible-pointer-types -DTCC_TARGET_PE
14#WINPWD = `cygpath --mixed $(PWD)`
15#@echo "#define CONFIG_TCCDIR \"$(WINPWD)\""
16
17ifeq ($(CPU), 64)
18NATIVE = -m$(CPU) -DTCC_TARGET_X86_64
19ARCH = x86_64
20else
21NATIVE = -m$(CPU) -DTCC_TARGET_I386
22ARCH = i386
23endif
24
25TARGET = $(CPU)
26
27ifeq ($(TARGET), 64)
28TFLAGS = -m$(TARGET) -DTCC_TARGET_X86_64
29TARCH = x86_64
30else
31TFLAGS = -m$(TARGET) -DTCC_TARGET_I386
32TARCH = i386
33endif
34
35all: pre bootstrap libs rebuild
36 @chmod 775 *.exe
37 @ls -ls *.exe
38
39pre:
40 @echo ARCH=$(TARCH) 1> ../config.mak
41 @echo TARGETOS=Windows 1>> ../config.mak
42 @echo CONFIG_WIN32=yes 1>> ../config.mak
43 @echo TOPSRC=$$\(TOP\) 1>> ../config.mak
44 @echo "#define TCC_VERSION \"$(VERSION)\"" 1>../config.h
45 @echo "#ifdef TCC_TARGET_X86_64" 1>>../config.h
46 @echo "#define TCC_LIBTCC1 \"libtcc1-64.a\"" 1>>../config.h
47 @echo "#else" 1>>../config.h
48 @echo "#define TCC_LIBTCC1 \"libtcc1-32.a\"" 1>>../config.h
49 @echo "#endif" 1>>../config.h
50 @echo @set VERSION $(VERSION) 1>../config.texi
51 @rm -f *tcc.exe tiny_*.exe *tcc.dll lib/*.a
52 @rm -r -f libtcc doc
53 @mkdir -p libtcc
54 @mkdir -p doc
55 @mkdir -p include
56 @mkdir -p lib
57 @cp -r ../win32/include/* include
58 @cp ../include/*.h include
59 @cp ../tcclib.h include
60 @cp ../libtcc.h include
61 @cp ../win32/lib/* lib
62 @cp ../win32/tcc-win32.txt doc
63 @cp ../tests/libtcc_test.c examples
64
65PHONY += pre
66
67bootstrap:
68 @echo Bootstrapping 32bits and 64bits tools with $(BOOTCC) -m$(CPU)
69 @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_I386 -o i386-win32-tcc.exe ../tcc.c
70 @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_X86_64 -o x86_64-win32-tcc.exe ../tcc.c
71 @$(BOOTCC) $(CFLAGS) $(NATIVE) -o tcc.exe ../tcc.c
72 @$(BOOTCC) $(CFLAGS) $(NATIVE) -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c
73
74PHONY += bootstrap
75
76TCC = wine ./tcc.exe
77
78lib/libtcc1-32.a:
79 @echo Building $*.a with tcc -m32
80 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/libtcc1.c
81 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86.S
82 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86-bt.S
83 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1.c
84 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1w.c
85 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1.c
86 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1w.c
87 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllcrt1.c
88 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllmain.c
89 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/chkstk.S
90 @$(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
91 @rm *.o
92
93lib/libtcc1-64.a:
94 @echo Building $*.a with tcc -m64
95 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c
96 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S
97 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64-bt.S
98 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1.c
99 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1w.c
100 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1.c
101 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1w.c
102 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllcrt1.c
103 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllmain.c
104 @$(TCC) -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/chkstk.S
105 @$(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
106 @rm *.o
107
108libs: lib/libtcc1-32.a lib/libtcc1-64.a
109
110PHONY += libs
111
112rebuild:
113 @echo Rebuild using tcc itself - default $(TARGET)bits
114 @wine ./$(TARCH)-win32-tcc.exe -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -o tcc.exe ../tcc.c
115 @$(TCC) -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c
116 @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe i386-win32-tcc.exe
117 @$(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
118
119PHONY += rebuild
120
121test:
122 @(cd ../tests; $(MAKE) -k TCC=$(PWD)/tcc hello-exe hello-run)
123 @(cd ../tests; $(MAKE) -k TCC=$(PWD)/tcc vla_test-run tests2-dir pp-dir)
124ifeq ($(CPU), 64)
125 @(cd ../tests; $(MAKE) -k TCC=$(PWD)/i386-win32-tcc hello-exe hello-run)
126 @(cd ../tests; $(MAKE) -k TCC=$(PWD)/i386-win32-tcc vla_test-run tests2-dir pp-dir)
127endif
128
129PHONY += test
130
131ARCHIVE = tcc-$(VERSION)-$(ARCH)-win32
132
133tarball:
134 @rm -r -f $(ARCHIVE)
135 @mkdir $(ARCHIVE)
136 @cp -r doc $(ARCHIVE)
137 @cp -r examples $(ARCHIVE)
138 @cp -r include $(ARCHIVE)
139 @cp -r lib $(ARCHIVE)
140 @cp -r libtcc $(ARCHIVE)
141 @cp -r i386-win32-tcc.exe $(ARCHIVE)
142 @cp -r libtcc.def $(ARCHIVE)
143 @cp -r libtcc.dll $(ARCHIVE)
144 @cp -r Makefile $(ARCHIVE)
145 @cp -r tcc.exe $(ARCHIVE)
146 @cp -r doc/tcc-win32.txt $(ARCHIVE)
147 @cp -r x86_64-win32-tcc.exe $(ARCHIVE)
148 @tar czf $(ARCHIVE).tar.gz $(ARCHIVE)
149 @zip -9 -q -r $(ARCHIVE).zip $(ARCHIVE)
150 @rm -r -f $(ARCHIVE)
151 @ls -g $(ARCHIVE)*
152
153PHONY += tarball
154
155clean:
156 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