]> git.saurik.com Git - wxWidgets.git/blame_incremental - distrib/msw/tmake/g95.t
Temporary ugly trick to make release for OpenWatcom possible.
[wxWidgets.git] / distrib / msw / tmake / g95.t
... / ...
CommitLineData
1#!#############################################################################
2#! File: g95.t
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
6#! Created: 14.07.99
7#! Version: $Id$
8#!#############################################################################
9#${
10 #! include the code which parses filelist.txt file and initializes
11 #! %wxCommon, %wxGeneric and %wxMSW hashes.
12 IncludeTemplate("filelist.t");
13
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' : '';
19
20 if ( $wxGeneric{$file} =~ /\b(PS|G|U|16)\b/ ) {
21 next #! unless $file =~ /^dirdlgg\./;
22 }
23
24 $file =~ s/cp?p?$/\$(OBJSUFF)/;
25 $project{"WXGENERICOBJS$base"} .= '$(GENDIR)/' . $file . " "
26 }
27
28 foreach $file (sort keys %wxCommon) {
29 next if $wxCommon{$file} =~ /\b(16|U)\b/;
30
31 #! needs extra files (sql*.h) so not compiled by default.
32 #! next if $file =~ /^odbc\./;
33
34 $base = ( $wxCommon{$file} =~ /\bB\b/ ) ? '_BASE' : '';
35 if ( $file =~ /^odbc\./ )
36 {
37 $file =~ s/cp?p?$/\$(OBJSUFF)/;
38 $project{"ADVANCEDOBJS$base"} .= '$(COMMDIR)/' . $file . " "
39 }
40 else
41 {
42 $file =~ s/cp?p?$/\$(OBJSUFF)/;
43 $project{"WXCOMMONOBJS$base"} .= '$(COMMDIR)/' . $file . " "
44 }
45 }
46
47 foreach $file (sort keys %wxBase) {
48 $file =~ s/cp?p?$/\$(OBJSUFF)/;
49 $project{"WXCOMMONOBJS_BASEONLY"} .= '$(COMMDIR)/' . $file . " "
50 }
51
52 foreach $file (sort keys %wxMSW) {
53 #! native wxDirDlg can't be compiled due to GnuWin32/OLE limitations,
54 next if $file =~ /^dirdlg\./;
55
56 next if $wxMSW{$file} =~ /\b(16)\b/;
57 $base = ( $wxMSW{$file} =~ /\bB\b/ ) ? '_BASE' : '';
58
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/ )
62 {
63 $file =~ s/cp?p?$/\$(OBJSUFF)/;
64 $project{"ADVANCEDOBJS$base"} .= '$(MSWDIR)/ole/' . $file . " "
65 }
66 else
67 {
68 $file =~ s/cp?p?$/\$(OBJSUFF)/;
69 $project{"WXMSWOBJS$base"} .= '$(MSWDIR)/' . $file . " "
70 }
71
72 }
73
74 foreach $file (sort keys %wxHTML) {
75 $file =~ s/cp?p?$/\$(OBJSUFF)/;
76 $project{"WXHTMLOBJS"} .= '$(HTMLDIR)/' . $file . " "
77 }
78
79#$}
80# This file was automatically generated by tmake
81# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
82
83#
84# File: makefile.g95
85# Author: Julian Smart, Robert Roebling, Vadim Zeitlin
86# Created: 1993
87# Updated: 1999
88# Copyright:(c) 1999, Vadim Zeitlin
89# Copyright:(c) 1999, Robert Roebling
90#
91# Makefile for libwx.a
92
93# Replace this with your own path if necessary
94WXDIR = ../..
95
96# All common compiler flags and options are now in
97# this central makefile.
98include $(WXDIR)/src/makeg95.env
99
100# DLL Name, if building wxWindows as a DLL.
101ifdef WXMAKINGDLL
102WXDLL = $(WXDIR)/lib/wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT)$(MIN_SUFFIX).dll
103WXDEF = wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT).def
104DLL_EXTRA_LIBS = $(WXDIR)/lib/libzlib$(MIN_SUFFIX).a \
105 $(WXDIR)/lib/libpng$(MIN_SUFFIX).a \
106 $(WXDIR)/lib/libjpeg$(MIN_SUFFIX).a \
107 $(WXDIR)/lib/libtiff$(MIN_SUFFIX).a \
108 $(WXDIR)/lib/libregex$(MIN_SUFFIX).a
109DLL_LDFLAGS = -L$(WXDIR)/lib
110DLL_BASE_LDLIBS = $(DLL_EXTRA_LIBS) -lstdc++ -lwsock32
111ifeq ($(wxUSE_GUI),0)
112 DLL_LDLIBS = $(DLL_BASE_LDLIBS)
113else
114 DLL_LDLIBS = -lcomctl32 -lctl3d32 -lole32 -loleaut32 \
115 -luuid -lrpcrt4 -lodbc32 -lwinmm -lopengl32 \
116 $(DLL_BASE_LDLIBS)
117endif
118endif
119
120# Subordinate library possibilities
121
122EXTRAOBJS=
123
124GENDIR = $(WXDIR)/src/generic
125COMMDIR = $(WXDIR)/src/common
126HTMLDIR = $(WXDIR)/src/html
127ZLIBDIR = $(WXDIR)/src/zlib
128PNGDIR = $(WXDIR)/src/png
129JPEGDIR = $(WXDIR)/src/jpeg
130TIFFDIR = $(WXDIR)/src/tiff
131OLEDIR = $(WXDIR)/src/msw/ole
132MSWDIR = $(WXDIR)/src/msw
133REGEXDIR= $(WXDIR)/src/regex
134
135ZLIBLIB = $(WXDIR)/lib/libzlib$(MIN_SUFFIX).a
136PNGLIB = $(WXDIR)/lib/libpng$(MIN_SUFFIX).a
137JPEGLIB = $(WXDIR)/lib/libjpeg$(MIN_SUFFIX).a
138TIFFLIB = $(WXDIR)/lib/libtiff$(MIN_SUFFIX).a
139REGEXLIB= $(WXDIR)/lib/libregex$(MIN_SUFFIX).a
140
141DOCDIR = $(WXDIR)/docs
142
143# Only use the WIN32 wxDirDialog if we have a recent
144# version of Mingw32
145ifeq "$(strip $(RECENT_MINGW))" "yes"
146 DIRDLGOBJ = $(MSWDIR)/dirdlg.$(OBJSUFF)
147else
148 DIRDLGOBJ = $(GENDIR)/dirdlgg.$(OBJSUFF)
149endif
150
151ifeq ($(wxUSE_GUI),0)
152 DIRDLGOBJ =
153endif
154
155GENERICOBJS_BASE = \
156 #$ ExpandList("WXGENERICOBJS_BASE");
157
158GENERICOBJS = \
159 $(GENERICOBJS_BASE) \
160 #$ ExpandList("WXGENERICOBJS");
161
162COMMONOBJS_BASE = \
163 #$ ExpandList("WXCOMMONOBJS_BASE");
164
165COMMONOBJS_BASEONLY = \
166 #$ ExpandList("WXCOMMONOBJS_BASEONLY");
167
168COMMONOBJS = \
169 $(COMMONOBJS_BASE) \
170 #$ ExpandList("WXCOMMONOBJS");
171
172HTMLOBJS = \
173 #$ ExpandList("WXHTMLOBJS");
174
175MSWOBJS_BASE = \
176 #$ ExpandList("WXMSWOBJS_BASE");
177
178MSWOBJS = \
179 $(MSWOBJS_BASE) \
180 #$ ExpandList("WXMSWOBJS");
181
182ADVANCEDOBJS_BASE = \
183 #$ ExpandList("ADVANCEDOBJS_BASE");
184
185ADVANCEDOBJS = \
186 $(ADVANCEDOBJS_BASE) \
187 #$ ExpandList("ADVANCEDOBJS");
188
189ZLIBOBJS = \
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)
204
205PNGOBJS = \
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)
221
222
223JPEGOBJS = \
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)
270
271TIFFOBJS = $(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 \
303 $(TIFFDIR)/tif_zip.o
304
305ifeq "$(strip $(RECENT_MINGW))" "yes"
306 OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJS) $(DIRDLGOBJ) $(ADVANCEDOBJS)
307else
308 OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) $(HTMLOBJS) $(DIRDLGOBJ)
309endif
310ifeq ($(wxUSE_GUI),0)
311 OBJECTS = $(MSWOBJS_BASE) $(COMMONOBJS_BASE) $(COMMONOBJS_BASEONLY) $(GENERICOBJS_BASE)
312endif
313
314# how do you do "VAR=\" ? BLEAGH!
315BACKSLASH=$(subst a,\,a)
316ifeq (,$(findstring $(OSTYPE),"cygwin!msys"))
317 PATH_SEPARATOR:=$(BACKSLASH)
318 PATH_SUBST=/
319else
320 PATH_SEPARATOR=/
321 PATH_SUBST:=$(BACKSLASH)
322endif
323
324#ARCHINCDIR=$(subst $(PATH_SUBST),$(PATH_SEPARATOR),$(WXDIR)/lib/msw$(INCEXT))
325ARCHINCDIR=$(WXDIR)/lib/$(TOOLKIT)$(INCEXT)
326
327SETUP_H=$(ARCHINCDIR)/wx/setup.h
328
329ifndef WXMAKINGDLL
330all: $(SETUP_H) $(OBJECTS) $(WXLIB) $(ZLIBLIB) $(PNGLIB) $(JPEGLIB) $(TIFFLIB) $(REGEXLIB)
331else
332all: $(SETUP_H) $(OBJECTS) $(ZLIBLIB) $(PNGLIB) $(JPEGLIB) $(TIFFLIB) $(REGEXLIB) $(WXDLL)
333endif
334
335$(ARCHINCDIR)/wx:
336 mkdir $(subst $(PATH_SUBST),$(PATH_SEPARATOR),$(ARCHINCDIR))
337 mkdir $(subst $(PATH_SUBST),$(PATH_SEPARATOR),$(ARCHINCDIR)/wx)
338
339# Copy ALWAYS uses forward slashes now.
340
341$(SETUP_H): $(ARCHINCDIR)/wx $(WXDIR)/include/wx/msw/setup.h
342 $(COPY) $(WXDIR)/include/wx/msw/setup.h $(subst $(BACKSLASH),/,$@)
343
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),$@)
346
347ifndef WXMAKINGDLL
348
349$(WXLIB): $(OBJECTS) $(EXTRAOBJS)
350 ar $(AROPTIONS) $@ $(EXTRAOBJS) $(OBJECTS)
351 $(RANLIB) $@
352
353else
354
355# The new linker is a few orders of magnitude faster than the old way
356# of creating DLLs.
357ifeq "$(strip $(LD_SUPPORTS_SHARED))" "yes"
358
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) \
365 $(ALL_LDFLAGS_DLL)
366else
367
368ifeq ($(MINGW32),1)
369 DLL_ENTRY = _DllMainCRTStartup@12
370else
371 DLL_ENTRY = __cygwin_dll_entry@12
372endif
373LD_STUFF = $(OBJECTS) $(EXTRAOBJS) -Wl,-e,$(DLL_ENTRY) \
374 $(DLL_LDFLAGS) $(DLL_LDLIBS) #-Wl,--image-base=0x66000000
375
376DLL_STUFF = --as=$(AS) --dllname $(notdir $(WXDLL)) \
377 --def $(WXDEF) \
378 --base-file wx.base --output-exp wx.exp
379
380$(WXDEF) $(WXLIB): $(OBJECTS) $(EXTRAOBJS)
381 $(DLLTOOL) --output-def $@ --output-lib $(WXLIB) \
382 --dllname $(notdir $(WXDLL)) \
383 $(OBJECTS) $(EXTRAOBJS) $(DLL_EXTRA_LIBS)
384
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)
391 -$(RM) wx.base
392 -$(RM) wx.exp
393
394endif
395
396endif
397
398
399$(ZLIBLIB): $(ZLIBOBJS)
400 $(AR) $(AROPTIONS) $@ $(ZLIBOBJS)
401 $(RANLIB) $@
402
403$(PNGLIB): $(PNGOBJS)
404 $(AR) $(AROPTIONS) $@ $(PNGOBJS)
405 $(RANLIB) $@
406
407$(JPEGLIB): $(JPEGOBJS)
408 $(AR) $(AROPTIONS) $@ $(JPEGOBJS)
409 $(RANLIB) $@
410
411$(TIFFLIB): $(TIFFOBJS)
412 $(AR) $(AROPTIONS) $@ $(TIFFOBJS)
413 $(RANLIB) $@
414
415$(REGEXLIB):
416 $(MAKE) -C $(REGEXDIR) -f makefile.g95 MINGW32=$(MINGW32) WXDIR=$(WXDIR) WXWIN=$(WXDIR)
417
418$(OBJECTS): $(WXINC)/wx/defs.h $(WXINC)/wx/object.h $(ARCHINCDIR)/wx/setup.h
419
420clean:
421 -$(RM) *.o
422 -$(RM) ole/*.o
423 -$(RM) *.bak
424 -$(RM) core
425 -$(RM) ../common/*.o
426 -$(RM) ../common/*.bak
427 -$(RM) ../generic/*.o
428 -$(RM) ../generic/*.bak
429 -$(RM) ../html/*.o
430 -$(RM) ../zlib/*.o
431 -$(RM) ../zlib/*.bak
432 -$(RM) ../png/*.o
433 -$(RM) ../png/*.bak
434 -$(RM) ../jpeg/*.o
435 -$(RM) ../jpeg/*.bak
436 -$(RM) ../tiff/*.o
437 -$(RM) ../tiff/*.bak
438 -$(RM) ../regex/*.o
439 -$(RM) ../regex/*.bak
440
441cleanall: clean
442 -$(RM) $(WXLIB)
443 -$(RM) $(ZLIBLIB)
444 -$(RM) $(PNGLIB)
445 -$(RM) $(JPEGLIB)
446 -$(RM) $(TIFFLIB)
447 -$(RM) $(REGEXLIB)
448
449ifdef WXMAKINGDLL
450 -$(RM) $(WXDLL)
451 -$(RM) $(WXDEF)
452ifneq "$(strip $(LD_SUPPORTS_SHARED))" "yes"
453 -$(RM) wx.base
454 -$(RM) wx.exp
455endif
456endif
457