Debian Codegraph @

makefile.win32.mingw

raw
1 #
2 # Makefile for building Regina with MingW32 compiler
3 #
4 # make -C MingW32-gcc-3.4.0-MT-DYNAMIC-DEBUG -f $(SRCDIR)/makefile.win32.mingw DEBUG=Y > MingW32-gcc-3.4.0-MT-DYNAMIC-DEBUG/make-out.log 2>&1
5 # make -C MingW32-gcc-3.4.0-MT-DYNAMIC-RELEASE -f $(SRCDIR)/makefile.win32.mingw > MingW32-gcc-3.4.0-MT-DYNAMIC-RELEASE/make-out.log 2>&1
6 #
7 # Run with -r switch
8 # eg make -r -f ..\makefile.win32.mingw
9 #
10
11 SRCDIR=$(REGINA_SRCDIR)
12 COMMONSRCDIR=$(SRCDIR)\common
13
14 include $(SRCDIR)/regina.ver
15
16 VERDOT = $(VER_DOT)
17 VERDATE = $(VER_DATE)
18
19 VEXTRA = -DREGINA_VERSION_DATE=\"$(VER_DATE)\" -DREGINA_VERSION_MAJOR=\"$(VER_MAJOR)\" -DREGINA_VERSION_MINOR=\"$(VER_MINOR)\" -DREGINA_VERSION_SUPP=\"$(VER_SUPP)\"
20
21 CC = gcc
22
23 ifeq ($(DEBUG),Y)
24 OPTIMIZE = -g -fbounds-checking -Wall
25 else
26 OPTIMIZE = -O3 -Wall -DNDEBUG
27 endif
28
29 ifeq ($(TRACEMEM),Y)
30 MEMTRACE = -DTRACEMEM
31 else
32 MEMTRACE =
33 endif
34
35 ifeq ($(FLISTS),N)
36 USEFLISTS = -DNOFLISTS
37 else
38 USEFLISTS =
39 endif
40
41 ifdef ($(SOCKET))
42 REXXSOCKET = "-DRXSOCKET=$(SOCKET)"
43 endif
44
45 THREADING = -mthreads
46 MT_FILE = mt_win32.o
47 LDFLAGS = -mwindows -mthreads
48 LDFLAGS1 = -mconsole -mthreads
49
50 ifeq ($(GCI),N)
51 GCI_SHO =
52 HAVE_GCI =
53 else
54 GCI_SHO = gci_call.ts.o gci_convert.ts.o gci_execute.ts.o gci_helper.ts.o gci_prepare.ts.o \
55 gci_reginabridge.ts.o gci_rxfuncdefine.ts.o gci_tree.ts.o
56 HAVE_GCI = -DHAVE_GCI -I$(SRCDIR)/gci -I.
57 endif
58
59 DYN_COMP = -DDYNAMIC -D__REGINA_DLL
60 SHL_TARGETS = rxqueue.exe rxstack.exe regina.exe rxtest1.dll rxtest2.dll
61 LD_RXLIB_PRE = $(CC) -shared -mwindows -mthreads
62 LD_RXLIB1 = -o rxtest1.dll -Wl,--export-all-symbols -Wl,--kill-at regina.a $(TCPLIBS)
63 LD_RXLIB2 = -o rxtest2.dll -Wl,--export-all-symbols -Wl,--kill-at regina.a $(TCPLIBS)
64
65 .SUFFIXES:
66
67 VPATH=$(SRCDIR)/ $(SRCDIR)/gci $(SRCDIR)/ntservice
68
69 OFILES = funcs.o builtin.o error.o variable.o interprt.o debug.o dbgfuncs.o memory.o parsing.o \
70 files.o misc.o unxfuncs.o arxfuncs.o cmsfuncs.o os2funcs.o shell.o rexxext.o stack.o \
71 extstack.o tracing.o interp.o cmath.o convert.o strengs.o library.o strmath.o signals.o \
72 macros.o envir.o expr.o instore.o rexxbif.o yaccsrc.o lexsrc.o options.o os_win.o \
73 wrappers.o os_other.o $(MT_FILE)
74
75 TSFILES = funcs.ts.o builtin.ts.o error.ts.o variable.ts.o extstack.ts.o rexxbif.ts.o interprt.ts.o \
76 debug.ts.o dbgfuncs.ts.o memory.ts.o parsing.ts.o files.ts.o misc.ts.o unxfuncs.ts.o \
77 arxfuncs.ts.o cmsfuncs.ts.o os2funcs.ts.o shell.ts.o rexxext.ts.o stack.ts.o tracing.ts.o \
78 interp.ts.o cmath.ts.o convert.ts.o strengs.ts.o library.ts.o strmath.ts.o signals.ts.o \
79 macros.ts.o envir.ts.o expr.ts.o instore.ts.o yaccsrc.ts.o lexsrc.ts.o wrappers.ts.o \
80 options.ts.o os_win.ts.o os_other.ts.o rexx.ts.o client.ts.o rexxsaa.ts.o mt_win32.ts.o \
81 $(GCI_SHO)
82
83 MTSSRC = $(SRCDIR)/en.mts $(SRCDIR)/pt.mts $(SRCDIR)/no.mts $(SRCDIR)/de.mts $(SRCDIR)/es.mts $(SRCDIR)/pl.mts $(SRCDIR)/tr.mts $(SRCDIR)/sv.mts
84
85 CEXTRA = $(REXXSOCKET) $(HAVE_GCI) $(VEXTRA) -funsigned-char
86 COPT = -MMD $(OPTIMIZE) $(CEXTRA) -I$(SRCDIR)/ $(MEMTRACE) $(NOFLISTS) $(THREADING)
87 COPTDYN = -MMD $(OPTIMIZE) $(CEXTRA) -I$(SRCDIR)/ $(MEMTRACE) $(NOFLISTS) $(DYN_COMP) $(THREADING)
88 TCPLIBS = -lwsock32
89
90 #%.c: *.l
91 # echo
92 #$(SRCDIR)/yaccsrc.h $(SRCDIR)/yaccsrc.c: $(SRCDIR)/yaccsrc.y
93 # bison -p__regina -o$(SRCDIR)/yaccsrc.c -d $(SRCDIR)/yaccsrc.y
94
95 #$(SRCDIR)/lexsrc.c: $(SRCDIR)/lexsrc.l
96 # flex -P__regina -Scontrib/flex.skl -8 -o$(SRCDIR)/lexsrc.c $(SRCDIR)/lexsrc.l
97
98 %.o: %.c
99 $(CC) -c $(COPT) -o $@ $<
100
101 %.ts.o: %.c
102 $(CC) -c $(COPTDYN) -o $@ $<
103
104 ifeq ($(GCI),Y)
105 ALL_DEPS = gci_convert.h trexx.exe rexx.exe rexx.a execiser.exe $(SHL_TARGETS) rxstack.exe rxqueue.exe threader.exe mtb_files
106 else
107 ALL_DEPS = trexx.exe rexx.exe rexx.a execiser.exe $(SHL_TARGETS) rxstack.exe rxqueue.exe threader.exe mtb_files
108 endif
109
110 all: $(ALL_DEPS)
111
112 trexx.exe : $(OFILES) rexx.o nosaa.o
113 $(CC) $(LDFLAGS1) -o trexx.exe $(OFILES) rexx.o nosaa.o $(TCPLIBS)
114
115 rexx.exe : $(OFILES) rexx.o rexxw32exe.o nosaa.o
116 $(CC) $(LDFLAGS1) -o rexx.exe $(OFILES) rexx.o rexxw32exe.o nosaa.o $(TCPLIBS)
117
118 regina.exe : regina.dll regina.o reginaw32exe.o
119 $(CC) $(LDFLAGS1) -o regina.exe regina.o regina.a reginaw32exe.o $(TCPLIBS)
120
121 execiser.exe : execiser.o regina.dll
122 $(CC) $(LDFLAGS1) -o execiser.exe execiser.o regina.a
123
124 rxqueue.exe : rxqueue.o erexxbif.o eextstack.o rxqueuew32exe.o
125 $(CC) $(LDFLAGS1) -o rxqueue.exe rxqueue.o erexxbif.o eextstack.o rxqueuew32exe.o $(TCPLIBS)
126
127 rxstack.exe : rxstack.o erexxbif_mt.o eextstack_mt.o service.o rxstackw32exe.o
128 $(CC) $(LDFLAGS1) -o rxstack.exe rxstack.o erexxbif_mt.o eextstack_mt.o service.o rxstackw32exe.o $(TCPLIBS)
129
130 threader.exe : threader.o regina.dll
131 $(CC) $(LDFLAGS1) -o threader.exe threader.o regina.a
132
133 rexx.a: $(OFILES) client.o drexx.o rexxsaa.o
134 ar rc rexx.a $(OFILES) client.o drexx.o rexxsaa.o
135
136 regina.dll: gci_convert.h $(TSFILES) reginaw32dll.o
137 $(CC) -shared $(LDFLAGS) -o regina.dll \
138 -Wl,--out-implib,regina.a -Wl,-Map,regina.dll.map -Wl,--cref \
139 rexx.a reginaw32dll.o *.ts.o $(TCPLIBS) $(SRCDIR)/regina_w32_mingw_dll.def
140
141 test1.o: $(SRCDIR)/test1.c
142 $(CC) -c $(COPTDYN) -U__REGINA_DLL -o test1.o $(SRCDIR)/test1.c
143
144 rxtest1.dll: test1.o regina.dll
145 $(LD_RXLIB_PRE) test1.o $(LD_RXLIB1)
146
147 test2.o: $(SRCDIR)/test2.c
148 $(CC) -c $(COPTDYN) -U__REGINA_DLL -o test2.o $(SRCDIR)/test2.c
149
150 rxtest2.dll: test2.o regina.dll
151 $(LD_RXLIB_PRE) test2.o $(LD_RXLIB2)
152
153 drexx.o: $(SRCDIR)/rexx.c
154 $(CC) -c $(COPT) -DRXLIB -o drexx.o $(SRCDIR)/rexx.c
155
156 rexx.ts.o: $(SRCDIR)/rexx.c
157 $(CC) -c $(COPTDYN) -DRXLIB -o rexx.ts.o $(SRCDIR)/rexx.c
158
159 rxqueue.o: $(SRCDIR)/rxqueue.c
160 $(CC) -c $(COPT) -DEXTERNAL_TO_REGINA -o rxqueue.o $(SRCDIR)/rxqueue.c
161
162 rxstack.o: $(SRCDIR)/rxstack.c
163 $(CC) -c $(COPT) -I$(SRCDIR)/ntservice -DEXTERNAL_TO_REGINA -DBUILD_NT_SERVICE -o rxstack.o $(SRCDIR)/rxstack.c
164
165 erexxbif_mt.o: $(SRCDIR)/rexxbif.c
166 $(CC) -c $(COPT) -DEXTERNAL_TO_REGINA -o erexxbif_mt.o $(SRCDIR)/rexxbif.c
167
168 erexxbif.o: $(SRCDIR)/rexxbif.c
169 $(CC) -c $(COPT) -DEXTERNAL_TO_REGINA -o erexxbif.o $(SRCDIR)/rexxbif.c
170
171 eextstack_mt.o: $(SRCDIR)/extstack.c
172 $(CC) -c $(COPT) -DEXTERNAL_TO_REGINA -o eextstack_mt.o $(SRCDIR)/extstack.c
173
174 eextstack.o: $(SRCDIR)/extstack.c
175 $(CC) -c $(COPT) -DEXTERNAL_TO_REGINA -o eextstack.o $(SRCDIR)/extstack.c
176
177 extstack.o: $(SRCDIR)/extstack.c
178 $(CC) -c $(COPT) -o extstack.o $(SRCDIR)/extstack.c
179
180 yaccsrc.o: $(SRCDIR)/yaccsrc.c
181 $(CC) -c $(COPT) -DYYMAXDEPTH=10000 -o yaccsrc.o $(SRCDIR)/yaccsrc.c
182
183 yaccsrc.ts.o: $(SRCDIR)/yaccsrc.c
184 $(CC) -c $(COPTDYN) -DYYMAXDEPTH=10000 -o yaccsrc.ts.o $(SRCDIR)/yaccsrc.c
185
186 threader.o: $(SRCDIR)/threader.c
187 $(CC) -c $(COPT) -DWIN32_THREADS -o threader.o $(SRCDIR)/threader.c
188
189 gci_convert.h: $(SRCDIR)/gci/gci_convert.win32.vc
190 cp $(SRCDIR)/gci/gci_convert.win32.vc gci_convert.h
191
192 mtb_files: msgcmp.exe $(MTSSRC)
193 msgcmp $(MTSSRC)
194
195 msgcmp.exe: msgcmp.o
196 $(CC) -o msgcmp.exe msgcmp.o
197
198 msgcmp.o: $(SRCDIR)/msgcmp.c
199 $(CC) $(COPT) -o msgcmp.o -c $(SRCDIR)/msgcmp.c
200
201 #
202 # Rules for resource files and version details
203 # We assume we have an already functional regina.exe
204 #
205 reginaw32dll.rc: $(SRCDIR)\regina.ver $(SRCDIR)\reginaw32dll.rc
206 trexx $(COMMONSRCDIR)\fixrc.rexx $(SRCDIR)\reginaw32dll.rc $@ $(VERDOT) $(VERDATE)
207 reginaw32exe.rc: $(SRCDIR)\regina.ver $(SRCDIR)\reginaw32exe.rc
208 trexx $(COMMONSRCDIR)\fixrc.rexx $(SRCDIR)\reginaw32exe.rc $@ $(VERDOT) $(VERDATE)
209 rxstackw32exe.rc: $(SRCDIR)\regina.ver $(SRCDIR)\rxstackw32exe.rc
210 trexx $(COMMONSRCDIR)\fixrc.rexx $(SRCDIR)\rxstackw32exe.rc $@ $(VERDOT) $(VERDATE)
211 rxqueuew32exe.rc: $(SRCDIR)\regina.ver $(SRCDIR)\rxqueuew32exe.rc
212 trexx $(COMMONSRCDIR)\fixrc.rexx $(SRCDIR)\rxqueuew32exe.rc $@ $(VERDOT) $(VERDATE)
213 rexxw32exe.rc: $(SRCDIR)\regina.ver $(SRCDIR)\rexxw32exe.rc
214 trexx $(COMMONSRCDIR)\fixrc.rexx $(SRCDIR)\rexxw32exe.rc $@ $(VERDOT) $(VERDATE)
215
216 reginaw32dll.o: reginaw32dll.rc
217 cp $(SRCDIR)/reginaw32.ico .
218 windres --include=$(SRCDIR)/ reginaw32dll.rc reginaw32dll.res
219 windres reginaw32dll.res reginaw32dll.o
220
221 reginatsw32dll.o: reginatsw32dll.rc
222 cp $(SRCDIR)/reginaw32.ico .
223 windres --include=$(SRCDIR)/ reginatsw32dll.rc reginatsw32dll.res
224 windres reginatsw32dll.res reginatsw32dll.o
225
226 reginaw32exe.o: reginaw32exe.rc
227 cp $(SRCDIR)/reginaw32.ico .
228 windres --include=$(SRCDIR)/ reginaw32exe.rc reginaw32exe.res
229 windres reginaw32exe.res reginaw32exe.o
230
231 rexxw32exe.o: rexxw32exe.rc
232 cp $(SRCDIR)/reginaw32.ico .
233 windres --include=$(SRCDIR)/ rexxw32exe.rc rexxw32exe.res
234 windres rexxw32exe.res rexxw32exe.o
235
236 rxstackw32exe.o: rxstackw32exe.rc
237 cp $(SRCDIR)/reginaw32.ico .
238 windres --include=$(SRCDIR)/ rxstackw32exe.rc rxstackw32exe.res
239 windres rxstackw32exe.res rxstackw32exe.o
240
241 rxqueuew32exe.o: rxqueuew32exe.rc
242 cp $(SRCDIR)/reginaw32.ico .
243 windres --include=$(SRCDIR)/ rxqueuew32exe.rc rxqueuew32exe.res
244 windres rxqueuew32exe.res rxqueuew32exe.o
245
246 zip:
247 zip -9r regina-mingw$(VER).zip * -x MingW32-gcc-3.4.0-MT-DYNAMIC-DEBUG/* -x MingW32-gcc-3.4.0-MT-DYNAMIC-RELEASE/*
248
249 #
250 # Build NSIS package...
251 #
252 dist: all
253 cp $(SRCDIR)/rexxsaa.h .
254 cp -r $(SRCDIR)/demo .
255 cp $(SRCDIR)/README.W32 .
256 cp $(SRCDIR)/README.33 .
257 cp $(SRCDIR)/COPYING-LIB .
258 cp $(SRCDIR)/regina_ss.ini .
259 cp $(SRCDIR)/regina_fa.ini .
260 cp $(SRCDIR)/regina_mt.ini .
261 cp $(SRCDIR)/regina_mingw.nsi .
262 cp $(SRCDIR)/common/isnt.nsh .
263 cp $(SRCDIR)/common/path.nsh .
264 cp $(SRCDIR)/common/WriteEnv.nsh .
265 cp $(SRCDIR)/common/uninstall.ico .
266 C:/Program\ Files/NSIS/makensis.exe /DVERSION=$(VERDOT) /DNODOTVER=$(VER) /DSRCDIR=. regina_mingw.nsi
267
268 DEPS := $(wildcard *.d)
269 ifneq ($(DEPS),)
270 include $(DEPS)
271 endif
272