1 #!#############################################################################
3 #! Purpose: tmake template file from which makefile.g95 is generated by running
4 #! tmake -t g95 wxwin.pro -o makefile.g95
5 #! Author: Vadim Zeitlin, Robert Roebling, Julian Smart
8 #!#############################################################################
10 #! include the code which parses filelist.txt file and initializes
11 #! %wxCommon, %wxGeneric and %wxMSW hashes.
12 IncludeTemplate("filelist.t");
14 #! now transform these hashes into $project tags
15 foreach $file (sort keys %wxGeneric) {
16 #! native wxDirDlg can't be compiled due to GnuWin32/OLE limitations,
17 #! so take the generic version
18 $base = ( $wxGeneric{$file} =~ /\bB\b/ ) ? '_BASE' : '';
20 if ( $wxGeneric{$file} =~ /\b(PS|G|U|16)\b/ ) {
21 next #! unless $file =~ /^dirdlgg\./;
24 $file =~ s/cp?p?$/\$(OBJSUFF)/;
25 $project{"WXGENERICOBJS$base"} .= '$(GENDIR)/' . $file . " "
28 foreach $file (sort keys %wxCommon) {
29 next if $wxCommon{$file} =~ /\b(16|U)\b/;
31 #! needs extra files (sql*.h) so not compiled by default.
32 #! next if $file =~ /^odbc\./;
34 $base = ( $wxCommon{$file} =~ /\bB\b/ ) ? '_BASE' : '';
35 if ( $file =~ /^odbc\./ )
37 $file =~ s/cp?p?$/\$(OBJSUFF)/;
38 $project{"ADVANCEDOBJS$base"} .= '$(COMMDIR)/' . $file . " "
42 $file =~ s/cp?p?$/\$(OBJSUFF)/;
43 $project{"WXCOMMONOBJS$base"} .= '$(COMMDIR)/' . $file . " "
47 foreach $file (sort keys %wxBase) {
48 $file =~ s/cp?p?$/\$(OBJSUFF)/;
49 $project{"WXCOMMONOBJS_BASEONLY"} .= '$(COMMDIR)/' . $file . " "
52 foreach $file (sort keys %wxMSW) {
53 #! native wxDirDlg can't be compiled due to GnuWin32/OLE limitations,
54 next if $file =~ /^dirdlg\./;
56 next if $wxMSW{$file} =~ /\b(16)\b/;
57 $base = ( $wxMSW{$file} =~ /\bB\b/ ) ? '_BASE' : '';
59 #! Mingw32 doesn't have the OLE headers and has some troubles with
60 #! socket code, so put in ADVANCEDOBJS
61 if ( $wxMSW{$file} =~ /\b(O)\b/ )
63 $file =~ s/cp?p?$/\$(OBJSUFF)/;
64 $project{"ADVANCEDOBJS$base"} .= '$(MSWDIR)/ole/' . $file . " "
68 $file =~ s/cp?p?$/\$(OBJSUFF)/;
69 $project{"WXMSWOBJS$base"} .= '$(MSWDIR)/' . $file . " "
74 foreach $file (sort keys %wxHTML) {
75 $file =~ s/cp?p?$/\$(OBJSUFF)/;
76 $project{"WXHTMLOBJS"} .= '$(HTMLDIR)/' . $file . " "
80 # This file was automatically generated by tmake
81 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
85 # Author: Julian Smart, Robert Roebling, Vadim Zeitlin
88 # Copyright:(c) 1993, AIAI, University of Edinburgh,
89 # Copyright:(c) 1999, Vadim Zeitlin
90 # Copyright:(c) 1999, Robert Roebling
92 # Makefile for libwx.a
94 # Replace this with your own path if necessary
97 # All common compiler flags and options are now in
98 # this central makefile.
99 include $(WXDIR)/src/makeg95.env
101 # DLL Name, if building wxWindows as a DLL.
103 WXDLL = $(WXDIR)/lib/wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT).dll
104 WXDEF = wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT).def
105 DLL_EXTRA_LIBS = $(WXDIR)/lib/libzlib.a \
106 $(WXDIR)/lib/libpng.a $(WXDIR)/lib/libjpeg.a \
107 $(WXDIR)/lib/libtiff.a $(WXDIR)/lib/libregex.a
108 DLL_LDFLAGS = -L$(WXDIR)/lib
109 DLL_BASE_LDLIBS = $(DLL_EXTRA_LIBS) -lstdc++ -lwsock32
110 ifeq ($(wxUSE_GUI),0)
111 DLL_LDLIBS = $(DLL_BASE_LDLIBS)
113 DLL_LDLIBS = -lcomctl32 -lctl3d32 -lole32 -loleaut32 \
114 -luuid -lrpcrt4 -lodbc32 -lwinmm -lopengl32 \
119 # Subordinate library possibilities
123 GENDIR = $(WXDIR)/src/generic
124 COMMDIR = $(WXDIR)/src/common
125 HTMLDIR = $(WXDIR)/src/html
126 ZLIBDIR = $(WXDIR)/src/zlib
127 PNGDIR = $(WXDIR)/src/png
128 JPEGDIR = $(WXDIR)/src/jpeg
129 TIFFDIR = $(WXDIR)/src/tiff
130 OLEDIR = $(WXDIR)/src/msw/ole
131 MSWDIR = $(WXDIR)/src/msw
132 REGEXDIR= $(WXDIR)/src/regex
134 ZLIBLIB = $(WXDIR)/lib/libzlib.a
135 PNGLIB = $(WXDIR)/lib/libpng.a
136 JPEGLIB = $(WXDIR)/lib/libjpeg.a
137 TIFFLIB = $(WXDIR)/lib/libtiff.a
138 REGEXLIB= $(WXDIR)/lib/libregex.a
140 DOCDIR = $(WXDIR)/docs
142 # Only use the WIN32 wxDirDialog if we have a recent
144 ifeq "$(strip $(RECENT_MINGW))" "yes"
145 DIRDLGOBJ = $(MSWDIR)/dirdlg.$(OBJSUFF)
147 DIRDLGOBJ = $(GENDIR)/dirdlgg.$(OBJSUFF)
150 ifeq ($(wxUSE_GUI),0)
155 #$ ExpandList("WXGENERICOBJS_BASE");
158 $(GENERICOBJS_BASE) \
159 #$ ExpandList("WXGENERICOBJS");
162 #$ ExpandList("WXCOMMONOBJS_BASE");
164 COMMONOBJS_BASEONLY = \
165 #$ ExpandList("WXCOMMONOBJS_BASEONLY");
169 $(COMMDIR)/y_tab.$(OBJSUFF) \
170 #$ ExpandList("WXCOMMONOBJS");
173 #$ ExpandList("WXHTMLOBJS");
176 #$ ExpandList("WXMSWOBJS_BASE");
180 #$ ExpandList("WXMSWOBJS");
182 ADVANCEDOBJS_BASE = \
183 #$ ExpandList("ADVANCEDOBJS_BASE");
186 $(ADVANCEDOBJS_BASE) \
187 #$ ExpandList("ADVANCEDOBJS");
190 $(ZLIBDIR)/adler32.$(OBJSUFF) \
191 $(ZLIBDIR)/compress.$(OBJSUFF) \
192 $(ZLIBDIR)/crc32.$(OBJSUFF) \
193 $(ZLIBDIR)/gzio.$(OBJSUFF) \
194 $(ZLIBDIR)/uncompr.$(OBJSUFF) \
195 $(ZLIBDIR)/deflate.$(OBJSUFF) \
196 $(ZLIBDIR)/trees.$(OBJSUFF) \
197 $(ZLIBDIR)/zutil.$(OBJSUFF) \
198 $(ZLIBDIR)/inflate.$(OBJSUFF) \
199 $(ZLIBDIR)/infblock.$(OBJSUFF) \
200 $(ZLIBDIR)/inftrees.$(OBJSUFF) \
201 $(ZLIBDIR)/infcodes.$(OBJSUFF) \
202 $(ZLIBDIR)/infutil.$(OBJSUFF) \
203 $(ZLIBDIR)/inffast.$(OBJSUFF)
206 $(PNGDIR)/png.$(OBJSUFF) \
207 $(PNGDIR)/pngread.$(OBJSUFF) \
208 $(PNGDIR)/pngrtran.$(OBJSUFF) \
209 $(PNGDIR)/pngrutil.$(OBJSUFF) \
210 $(PNGDIR)/pngpread.$(OBJSUFF) \
211 $(PNGDIR)/pngtrans.$(OBJSUFF) \
212 $(PNGDIR)/pngwrite.$(OBJSUFF) \
213 $(PNGDIR)/pngwtran.$(OBJSUFF) \
214 $(PNGDIR)/pngwutil.$(OBJSUFF) \
215 $(PNGDIR)/pngerror.$(OBJSUFF) \
216 $(PNGDIR)/pngmem.$(OBJSUFF) \
217 $(PNGDIR)/pngwio.$(OBJSUFF) \
218 $(PNGDIR)/pngrio.$(OBJSUFF) \
219 $(PNGDIR)/pngget.$(OBJSUFF) \
220 $(PNGDIR)/pngset.$(OBJSUFF)
224 $(JPEGDIR)/jcomapi.$(OBJSUFF) \
225 $(JPEGDIR)/jutils.$(OBJSUFF) \
226 $(JPEGDIR)/jerror.$(OBJSUFF) \
227 $(JPEGDIR)/jmemmgr.$(OBJSUFF) \
228 $(JPEGDIR)/jmemnobs.$(OBJSUFF) \
229 $(JPEGDIR)/jcapimin.$(OBJSUFF) \
230 $(JPEGDIR)/jcapistd.$(OBJSUFF) \
231 $(JPEGDIR)/jctrans.$(OBJSUFF) \
232 $(JPEGDIR)/jcparam.$(OBJSUFF) \
233 $(JPEGDIR)/jdatadst.$(OBJSUFF) \
234 $(JPEGDIR)/jcinit.$(OBJSUFF) \
235 $(JPEGDIR)/jcmaster.$(OBJSUFF) \
236 $(JPEGDIR)/jcmarker.$(OBJSUFF) \
237 $(JPEGDIR)/jcmainct.$(OBJSUFF) \
238 $(JPEGDIR)/jcprepct.$(OBJSUFF) \
239 $(JPEGDIR)/jccoefct.$(OBJSUFF) \
240 $(JPEGDIR)/jccolor.$(OBJSUFF) \
241 $(JPEGDIR)/jcsample.$(OBJSUFF) \
242 $(JPEGDIR)/jchuff.$(OBJSUFF) \
243 $(JPEGDIR)/jcphuff.$(OBJSUFF) \
244 $(JPEGDIR)/jcdctmgr.$(OBJSUFF) \
245 $(JPEGDIR)/jfdctfst.$(OBJSUFF) \
246 $(JPEGDIR)/jfdctflt.$(OBJSUFF) \
247 $(JPEGDIR)/jfdctint.$(OBJSUFF) \
248 $(JPEGDIR)/jdapimin.$(OBJSUFF) \
249 $(JPEGDIR)/jdapistd.$(OBJSUFF) \
250 $(JPEGDIR)/jdtrans.$(OBJSUFF) \
251 $(JPEGDIR)/jdatasrc.$(OBJSUFF) \
252 $(JPEGDIR)/jdmaster.$(OBJSUFF) \
253 $(JPEGDIR)/jdinput.$(OBJSUFF) \
254 $(JPEGDIR)/jdmarker.$(OBJSUFF) \
255 $(JPEGDIR)/jdhuff.$(OBJSUFF) \
256 $(JPEGDIR)/jdphuff.$(OBJSUFF) \
257 $(JPEGDIR)/jdmainct.$(OBJSUFF) \
258 $(JPEGDIR)/jdcoefct.$(OBJSUFF) \
259 $(JPEGDIR)/jdpostct.$(OBJSUFF) \
260 $(JPEGDIR)/jddctmgr.$(OBJSUFF) \
261 $(JPEGDIR)/jidctfst.$(OBJSUFF) \
262 $(JPEGDIR)/jidctflt.$(OBJSUFF) \
263 $(JPEGDIR)/jidctint.$(OBJSUFF) \
264 $(JPEGDIR)/jidctred.$(OBJSUFF) \
265 $(JPEGDIR)/jdsample.$(OBJSUFF) \
266 $(JPEGDIR)/jdcolor.$(OBJSUFF) \
267 $(JPEGDIR)/jquant1.$(OBJSUFF) \
268 $(JPEGDIR)/jquant2.$(OBJSUFF) \
269 $(JPEGDIR)/jdmerge.$(OBJSUFF)
271 TIFFOBJS = $(TIFFDIR)/tif_aux.o \
272 $(TIFFDIR)/tif_close.o \
273 $(TIFFDIR)/tif_codec.o \
274 $(TIFFDIR)/tif_compress.o \
275 $(TIFFDIR)/tif_dir.o \
276 $(TIFFDIR)/tif_dirinfo.o \
277 $(TIFFDIR)/tif_dirread.o \
278 $(TIFFDIR)/tif_dirwrite.o \
279 $(TIFFDIR)/tif_dumpmode.o \
280 $(TIFFDIR)/tif_error.o \
281 $(TIFFDIR)/tif_fax3.o \
282 $(TIFFDIR)/tif_fax3sm.o \
283 $(TIFFDIR)/tif_flush.o \
284 $(TIFFDIR)/tif_getimage.o \
285 $(TIFFDIR)/tif_jpeg.o \
286 $(TIFFDIR)/tif_luv.o \
287 $(TIFFDIR)/tif_lzw.o \
288 $(TIFFDIR)/tif_next.o \
289 $(TIFFDIR)/tif_open.o \
290 $(TIFFDIR)/tif_packbits.o \
291 $(TIFFDIR)/tif_pixarlog.o \
292 $(TIFFDIR)/tif_predict.o \
293 $(TIFFDIR)/tif_print.o \
294 $(TIFFDIR)/tif_read.o \
295 $(TIFFDIR)/tif_strip.o \
296 $(TIFFDIR)/tif_swab.o \
297 $(TIFFDIR)/tif_thunder.o \
298 $(TIFFDIR)/tif_tile.o \
299 $(TIFFDIR)/tif_version.o \
300 $(TIFFDIR)/tif_warning.o \
301 $(TIFFDIR)/tif_win32.o \
302 $(TIFFDIR)/tif_write.o \
305 ifeq "$(strip $(RECENT_MINGW))" "yes"
306 OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJS) $(DIRDLGOBJ) $(ADVANCEDOBJS)
308 OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJS) $(DIRDLGOBJ)
310 ifeq ($(wxUSE_GUI),0)
311 OBJECTS = $(MSWOBJS_BASE) $(COMMONOBJS_BASE) $(COMMONOBJS_BASEONLY) $(GENERICOBJS_BASE)
314 # how do you do "VAR=\" ? BLEAGH!
315 BACKSLASH=$(subst a,\,a)
316 ifeq (,$(findstring $(OSTYPE),"cygwin!msys"))
317 PATH_SEPARATOR:=$(BACKSLASH)
321 PATH_SUBST:=$(BACKSLASH)
324 #ARCHINCDIR=$(subst $(PATH_SUBST),$(PATH_SEPARATOR),$(WXDIR)/lib/msw$(INCEXT))
325 ARCHINCDIR=$(WXDIR)/lib/$(TOOLKIT)$(INCEXT)
327 SETUP_H=$(ARCHINCDIR)/wx/setup.h
330 all: $(SETUP_H) $(OBJECTS) $(WXLIB) $(ZLIBLIB) $(PNGLIB) $(JPEGLIB) $(TIFFLIB) $(REGEXLIB)
332 all: $(SETUP_H) $(OBJECTS) $(ZLIBLIB) $(PNGLIB) $(JPEGLIB) $(TIFFLIB) $(REGEXLIB) $(WXDLL)
336 mkdir $(subst $(PATH_SUBST),$(PATH_SEPARATOR),$(ARCHINCDIR))
337 mkdir $(subst $(PATH_SUBST),$(PATH_SEPARATOR),$(ARCHINCDIR)/wx)
339 # Copy ALWAYS uses forward slashes now.
341 $(SETUP_H): $(ARCHINCDIR)/wx $(WXDIR)/include/wx/msw/setup.h
342 $(COPY) $(WXDIR)/include/wx/msw/setup.h $(subst $(BACKSLASH),/,$@)
344 # $(COPY) $(WXDIR)/include/wx/msw/setup.h $@
345 # $(COPY) $(subst $(PATH_SUBST),$(PATH_SEPARATOR),$(WXDIR)/include/wx/msw/setup.h) $(subst $(PATH_SUBST),$(PATH_SEPARATOR),$@)
349 $(WXLIB): $(OBJECTS) $(EXTRAOBJS)
350 ar $(AROPTIONS) $@ $(EXTRAOBJS) $(OBJECTS)
355 # The new linker is a few orders of magnitude faster than the old way
357 ifeq "$(strip $(LD_SUPPORTS_SHARED))" "yes"
359 $(WXDLL): $(OBJECTS) $(EXTRAOBJS)
360 $(CXX) -shared -o $@ \
361 -Wl,--output-def,$(WXDEF) \
362 -Wl,--out-implib,$(WXLIB) \
363 $(OBJECTS) $(EXTRAOBJS) \
364 $(DLL_LDFLAGS) $(DLL_LDLIBS) \
369 DLL_ENTRY = _DllMainCRTStartup@12
371 DLL_ENTRY = __cygwin_dll_entry@12
373 LD_STUFF = $(OBJECTS) $(EXTRAOBJS) -Wl,-e,$(DLL_ENTRY) \
374 $(DLL_LDFLAGS) $(DLL_LDLIBS) #-Wl,--image-base=0x66000000
376 DLL_STUFF = --as=$(AS) --dllname $(notdir $(WXDLL)) \
378 --base-file wx.base --output-exp wx.exp
380 $(WXDEF) $(WXLIB): $(OBJECTS) $(EXTRAOBJS)
381 $(DLLTOOL) --output-def $@ --output-lib $(WXLIB) \
382 --dllname $(notdir $(WXDLL)) \
383 $(OBJECTS) $(EXTRAOBJS) $(DLL_EXTRA_LIBS)
385 $(WXDLL): $(OBJECTS) $(EXTRAOBJS) $(WXDEF)
386 $(CC) -mdll -Wl,--base-file,wx.base -s -o $@ $(LD_STUFF) $(ALL_LDFLAGS_DLL)
387 $(DLLTOOL) $(DLL_STUFF)
388 $(CC) -mdll -Wl,--base-file,wx.base wx.exp -s -o $@ $(LD_STUFF) $(ALL_LDFLAGS_DLL)
389 $(DLLTOOL) $(DLL_STUFF)
390 $(CC) -mdll wx.exp -o $@ $(LD_STUFF) $(ALL_LDFLAGS_DLL)
399 $(ZLIBLIB): $(ZLIBOBJS)
400 $(AR) $(AROPTIONS) $@ $(ZLIBOBJS)
403 $(PNGLIB): $(PNGOBJS)
404 $(AR) $(AROPTIONS) $@ $(PNGOBJS)
407 $(JPEGLIB): $(JPEGOBJS)
408 $(AR) $(AROPTIONS) $@ $(JPEGOBJS)
411 $(TIFFLIB): $(TIFFOBJS)
412 $(AR) $(AROPTIONS) $@ $(TIFFOBJS)
416 $(MAKE) -C $(REGEXDIR) -f makefile.g95 WXDIR=$(WXDIR) WXWIN=$(WXDIR)
418 $(OBJECTS): $(WXINC)/wx/defs.h $(WXINC)/wx/object.h $(ARCHINCDIR)/wx/setup.h
420 $(COMMDIR)/y_tab.$(OBJSUFF): $(COMMDIR)/y_tab.c $(COMMDIR)/lex_yy.c
421 $(CCLEX) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -DUSE_DEFINE -DYY_USE_PROTOS -o $@ $(COMMDIR)/y_tab.c
423 $(COMMDIR)/y_tab.c: $(COMMDIR)/dosyacc.c
424 $(COPY) ../common/dosyacc.c ../common/y_tab.c
426 $(COMMDIR)/lex_yy.c: $(COMMDIR)/doslex.c
427 $(COPY) ../common/doslex.c ../common/lex_yy.c
429 # Replace lex with flex if you run into compilation
430 # problems with lex_yy.c. See also note about LEX_SCANNER
432 # $(COMMDIR)/lex_yy.c: $(COMMDIR)/lexer.l
433 # $(LEX) -L -o$(COMMDIR)/lex_yy.c $(COMMDIR)/lexer.l
435 # Try one of these if the above line doesn't work.
436 # Alternative syntax (1)
437 # $(LEX) -t -L $(COMMDIR)/lexer.l > $(COMMDIR)/lex_yy.c
438 # Alternative syntax (2)
439 # $(LEX) -L -o$(COMMDIR)/lex_yy.c $(COMMDIR)/lexer.l
441 # sed -e "s/BUFSIZ/5000/g" < lex.yy.c | \
442 # sed -e "s/yyoutput(c)/void yyoutput(c)/g" | \
443 # sed -e "s/YYLMAX 200/YYLMAX 5000/g" > lex_yy.c
446 # Replace yacc with bison if you run into compilation
447 # problems with y_tab.c.
449 # $(COMMDIR)/y_tab.c: $(COMMDIR)/parser.y
450 # $(YACC) -o $(COMMDIR)/y_tab.c $(COMMDIR)/parser.y
452 # If you use e.g. gcc on Unix, uncomment these lines
453 # and comment out the above.
455 # $(COMMDIR)/y_tab.c: $(COMMDIR)/parser.y
456 # $(YACC) $(COMMDIR)/parser.y
457 # mv y.tab.c $(COMMDIR)/y_tab.c
464 -$(RM) ../common/y_tab.c
465 -$(RM) ../common/lex_yy.c
467 -$(RM) ../common/*.bak
468 -$(RM) ../generic/*.o
469 -$(RM) ../generic/*.bak
480 -$(RM) ../regex/*.bak
493 ifneq "$(strip $(LD_SUPPORTS_SHARED))" "yes"