1 #!#############################################################################
3 #! Purpose: tmake template file from which makefile.wat is generated by running
4 #! tmake -t wat wxwin.pro -o makefile.wat
6 #! - extended.c, unzip.c must be compiled with $(CC), not $(CCC).
7 #! - extended.c, unzip.c targets must be as per b32.t etc.
8 #! - OLE files not generated correctly (need 'ole/' directory)
9 #! Author: Vadim Zeitlin
12 #!#############################################################################
14 #! include the code which parses filelist.txt file and initializes
15 #! %wxCommon, %wxGeneric and %wxMSW hashes.
16 IncludeTemplate("filelist.t");
18 #! now transform these hashes into $project tags
19 foreach $file (sort keys %wxGeneric) {
21 if ( $wxGeneric{$file} =~ /\b(PS|G|16|U)\b/ ) {
22 $tag = "WXNONESSENTIALOBJS";
25 $tag = "WXGENERICOBJS";
28 $file =~ s/cp?p?$/obj/;
29 $project{$tag} .= $file . " "
32 foreach $file (sort keys %wxHTML) {
33 next if $wxHTML{$file} =~ /\b16\b/;
35 $file =~ s/cp?p?$/obj/;
36 $project{"WXHTMLOBJS"} .= $file . " "
39 foreach $file (sort keys %wxCommon) {
40 $isCFile = $file =~ /\.c$/;
41 $file =~ s/cp?p?$/obj/;
42 $project{"WXCOMMONOBJS"} .= $file . " ";
43 $project{"WXCOBJS"} .= $file . " " if $isCFile;
46 foreach $file (sort keys %wxMSW) {
47 #! these files don't compile
48 next if $file =~ /^pnghand\./;
50 #! next if $wxGeneric{$file} =~ /\b16\b/;
52 my $isOleObj = $wxMSW{$file} =~ /\bO\b/;
53 my $isCFile = $file =~ /\.c$/;
54 $file =~ s/cp?p?$/obj/;
55 $project{"WXMSWOBJS"} .= $file . " ";
56 $project{"WXCOBJS"} .= $file . " " if $isCFile;
57 $project{"WXOLEOBJS"} .= $file . " " if $isOleObj
60 #! an attempt to embed '#' directly in the string somehow didn't work...
61 #$ $text = chr(35) . '!/binb/wmake.exe';
63 # This file was automatically generated by tmake at #$ Now()
64 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
68 # Author: Julian Smart
71 # Makefile : Builds wxWindows library for Watcom C++, WIN32
73 # NOTE: This file is generated from wat.t by tmake, but not all bugs have
74 # been removed from this process. If wxWindows doesn't compile,
75 # check the following and edit this makefile accordingly:
77 # - OLE-related files such as oleutils.cpp should have 'ole\' prepended
79 # - extended.c, gsocket.c, unzip.c must be compiled using $(CC), not $(CCC).
80 # They may also be wrongly specified as extended.cpp, etc.
84 !include $(WXDIR)\src\makewat.env
88 LIBTARGET = $(WXLIB)\wx.lib
90 # ODBCLIB = ..\..\contrib\odbc\odbc32.lib
92 EXTRATARGETS = png zlib jpeg tiff regex
93 EXTRATARGETSCLEAN = clean_png clean_zlib clean_jpeg clean_tiff clean_regex
94 GENDIR=$(WXDIR)\src\generic
95 COMMDIR=$(WXDIR)\src\common
96 JPEGDIR=$(WXDIR)\src\jpeg
97 TIFFDIR=$(WXDIR)\src\tiff
98 MSWDIR=$(WXDIR)\src\msw
100 HTMLDIR=$(WXDIR)\src\html
102 DOCDIR = $(WXDIR)\docs
104 GENERICOBJS= #$ ExpandGlue("WXGENERICOBJS", "", " &\n\t")
106 # These are generic things that don't need to be compiled on MSW,
107 # but sometimes it's useful to do so for testing purposes.
108 NONESSENTIALOBJS= #$ ExpandGlue("WXNONESSENTIALOBJS", "", " &\n\t")
112 #$ ExpandGlue("WXCOMMONOBJS", "", " &\n\t")
114 MSWOBJS = #$ ExpandGlue("WXMSWOBJS", "", " &\n\t")
116 HTMLOBJS = #$ ExpandGlue("WXHTMLOBJS", "", " &\n\t")
118 # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
119 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) $(HTMLOBJS)
121 ARCHINCDIR=$(WXDIR)\lib\msw
122 SETUP_H=$(ARCHINCDIR)\wx\setup.h
124 all: $(SETUP_H) $(OBJECTS) $(LIBTARGET) $(EXTRATARGETS) .SYMBOLIC
128 mkdir $(ARCHINCDIR)\wx
130 $(SETUP_H): $(WXDIR)\include\wx\msw\setup.h $(ARCHINCDIR)\wx
131 copy $(WXDIR)\include\wx\msw\setup.h $@
133 $(LIBTARGET) : $(OBJECTS)
135 @for %i in ( $(OBJECTS) ) do @%append tmp.lbc +%i
136 wlib /b /c /n /p=512 $^@ @tmp.lbc
140 # @for %i in ( $(OBJECTS) ) do @%append tmp.lbc +%i
141 # wlib /b /c /n /p=512 $^@ @tmp.lbc
144 clean: .SYMBOLIC $(EXTRATARGETSCLEAN)
154 $_ = $project{"WXMSWOBJS"};
157 $text .= $_ . ': $(';
159 if ( $project{"WXOLEOBJS"} =~ /\b\Q$_\E\b/ ) {
160 $text .= 'OLEDIR)\\';
162 $text .= 'MSWDIR)\\';
165 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
173 $text .= $_ . ".$suffix\n" .
174 " *\$($cc) \$(CPPFLAGS) \$(IFLAGS) \$<" . "\n\n";
178 ########################################################
179 # Common objects (always compiled)
182 $_ = $project{"WXCOMMONOBJS"};
187 $text .= ': $(COMMDIR)\\';
189 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
197 $text .= $_ . ".$suffix\n" .
198 " *\$($cc) \$(CPPFLAGS) \$(IFLAGS) \$<" . "\n\n";
202 y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
203 *$(CC) $(CPPFLAGS) $(IFLAGS) -DUSE_DEFINE $(COMMDIR)\y_tab.c
205 # *$(CC) $(CPPFLAGS) $(IFLAGS) -DUSE_DEFINE -DYY_USE_PROTOS $(COMMDIR)\y_tab.c
207 $(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c
208 copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
210 $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c
211 copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
213 ########################################################
214 # Generic objects (not always compiled, depending on
215 # whether platforms have native implementations)
218 $_ = $project{"WXGENERICOBJS"};
223 $text .= ': $(GENDIR)\\';
224 $text .= $_ . ".cpp\n" .
225 ' *$(CCC) $(CPPFLAGS) $(IFLAGS) $<' . "\n\n";
230 ########################################################
231 # HTML objects (always compiled)
234 $_ = $project{"WXHTMLOBJS"};
239 $text .= ': $(HTMLDIR)\\';
240 $text .= $_ . ".cpp\n" .
241 ' *$(CCC) $(CPPFLAGS) $(IFLAGS) $<' . "\n\n";
247 wmake -f makefile.wat all
252 wmake -f makefile.wat clean
257 wmake -f makefile.wat all
260 clean_zlib: .SYMBOLIC
262 wmake -f makefile.wat clean
267 wmake -f makefile.wat all
270 clean_jpeg: .SYMBOLIC
272 wmake -f makefile.wat clean
277 wmake -f makefile.wat all
280 clean_tiff: .SYMBOLIC
282 wmake -f makefile.wat clean
286 cd $(WXDIR)\src\regex
287 wmake -f makefile.wat all
290 clean_regex: .SYMBOLIC
291 cd $(WXDIR)\src\regex
292 wmake -f makefile.wat clean
296 self : .SYMBOLIC $(WXDIR)\distrib\msw\tmake\filelist.txt $(WXDIR)\distrib\msw\tmake\$(MFTYPE).t
297 cd $(WXDIR)\distrib\msw\tmake
298 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
299 copy makefile.$(MFTYPE) $(WXDIR)\src\msw