1 #!#############################################################################
3 #! Purpose: tmake template file from which makefile.wat is generated by running
4 #! tmake -t wat wxwin.pro -o makefile.wat
5 #! Author: Vadim Zeitlin
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) {
17 if ( $wxGeneric{$file} =~ /\b(PS|G|16|U)\b/ ) {
18 $tag = "WXNONESSENTIALOBJS";
21 $tag = "WXGENERICOBJS";
24 $file =~ s/cp?p?$/obj/;
25 $project{$tag} .= $file . " "
28 foreach $file (sort keys %wxHTML) {
29 next if $wxHTML{$file} =~ /\b16\b/;
31 $file =~ s/cp?p?$/obj/;
32 $project{"WXHTMLOBJS"} .= $file . " "
35 foreach $file (sort keys %wxCommon) {
36 next if $wxCommon{$file} =~ /\b(16|U)\b/;
38 $isCFile = $file =~ /\.c$/;
39 $file =~ s/cp?p?$/obj/;
40 $project{"WXCOMMONOBJS"} .= $file . " ";
41 $project{"WXCOBJS"} .= $file . " " if $isCFile;
44 foreach $file (sort keys %wxMSW) {
45 #! these files don't compile
46 next if $file =~ /^pnghand\./;
48 next if $wxMSW{$file} =~ /\b16\b/;
50 my $isOleObj = $wxMSW{$file} =~ /\bO\b/;
51 my $isCFile = $file =~ /\.c$/;
52 $file =~ s/cp?p?$/obj/;
53 $project{"WXMSWOBJS"} .= $file . " ";
54 $project{"WXCOBJS"} .= $file . " " if $isCFile;
55 $project{"WXOLEOBJS"} .= $file . " " if $isOleObj
58 #! an attempt to embed '#' directly in the string somehow didn't work...
59 #$ $text = chr(35) . '!/binb/wmake.exe';
61 # This file was automatically generated by tmake
62 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
66 # Author: Julian Smart
69 # Makefile : Builds wxWindows library for Watcom C++, WIN32
70 !include ..\makewat.env
72 LIBTARGET = $(WXDIR)\lib\$(LIBNAME).lib
74 EXTRATARGETS = png zlib jpeg tiff regex
75 EXTRATARGETSCLEAN = clean_png clean_zlib clean_jpeg clean_tiff clean_regex
76 GENDIR=$(WXDIR)\src\generic
77 COMMDIR=$(WXDIR)\src\common
78 JPEGDIR=$(WXDIR)\src\jpeg
79 TIFFDIR=$(WXDIR)\src\tiff
80 MSWDIR=$(WXDIR)\src\msw
82 HTMLDIR=$(WXDIR)\src\html
84 DOCDIR = $(WXDIR)\docs
86 GENERICOBJS= #$ ExpandGlue("WXGENERICOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
88 # These are generic things that don't need to be compiled on MSW,
89 # but sometimes it's useful to do so for testing purposes.
90 NONESSENTIALOBJS= #$ ExpandGlue("WXNONESSENTIALOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
93 $(OUTPUTDIR)\y_tab.obj &
94 #$ ExpandGlue("WXCOMMONOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
96 MSWOBJS = #$ ExpandGlue("WXMSWOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
98 HTMLOBJS = #$ ExpandGlue("WXHTMLOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
100 # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
101 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) $(HTMLOBJS)
103 SETUP_H=$(ARCHINCDIR)\wx\setup.h
105 all: $(SETUP_H) $(OUTPUTDIR) $(OBJECTS) $(LIBTARGET) $(EXTRATARGETS) .SYMBOLIC
109 mkdir $(ARCHINCDIR)\wx
112 @if not exist $^@ mkdir $^@
114 $(SETUP_H): $(WXDIR)\include\wx\msw\setup.h $(ARCHINCDIR)\wx
115 copy $(WXDIR)\include\wx\msw\setup.h $@
117 LBCFILE=wx$(TOOLKIT).lbc
118 $(LIBTARGET) : $(OBJECTS)
120 @for %i in ( $(OBJECTS) ) do @%append $(LBCFILE) +%i
121 wlib /b /c /n /p=512 $^@ @$(LBCFILE)
124 clean: .SYMBOLIC $(EXTRATARGETSCLEAN)
134 $_ = $project{"WXMSWOBJS"};
137 $text .= "\$(OUTPUTDIR)\\" . $_ . ': $(';
139 if ( $project{"WXOLEOBJS"} =~ /\b\Q$_\E\b/ ) {
140 $text .= 'OLEDIR)\\';
142 $text .= 'MSWDIR)\\';
145 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
155 $text .= $_ . ".$suffix\n" .
156 " *\$($cc) \$($flags) \$<" . "\n\n";
160 ########################################################
161 # Common objects (always compiled)
164 $_ = $project{"WXCOMMONOBJS"};
167 $text .= "\$(OUTPUTDIR)\\" . $_;
169 $text .= ': $(COMMDIR)\\';
171 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
181 $text .= $_ . ".$suffix\n" .
182 " *\$($cc) \$($flags) \$<" . "\n\n";
186 $(OUTPUTDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
187 *$(CC) $(CFLAGS) -DUSE_DEFINE $(COMMDIR)\y_tab.c
189 $(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c
190 copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
192 $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c
193 copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
195 ########################################################
196 # Generic objects (not always compiled, depending on
197 # whether platforms have native implementations)
200 $_ = $project{"WXGENERICOBJS"};
203 $text .= "\$(OUTPUTDIR)\\" . $_;
205 $text .= ': $(GENDIR)\\';
206 $text .= $_ . ".cpp\n" .
207 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
212 ########################################################
213 # HTML objects (always compiled)
216 $_ = $project{"WXHTMLOBJS"};
219 $text .= "\$(OUTPUTDIR)\\" . $_;
221 $text .= ': $(HTMLDIR)\\';
222 $text .= $_ . ".cpp\n" .
223 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
229 wmake -f makefile.wat all
234 wmake -f makefile.wat clean
239 wmake -f makefile.wat all
242 clean_zlib: .SYMBOLIC
244 wmake -f makefile.wat clean
249 wmake -f makefile.wat all
252 clean_jpeg: .SYMBOLIC
254 wmake -f makefile.wat clean
259 wmake -f makefile.wat all
262 clean_tiff: .SYMBOLIC
264 wmake -f makefile.wat clean
268 cd $(WXDIR)\src\regex
269 wmake -f makefile.wat all
272 clean_regex: .SYMBOLIC
273 cd $(WXDIR)\src\regex
274 wmake -f makefile.wat clean
278 self : .SYMBOLIC $(WXDIR)\distrib\msw\tmake\filelist.txt $(WXDIR)\distrib\msw\tmake\$(MFTYPE).t
279 cd $(WXDIR)\distrib\msw\tmake
280 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
281 copy makefile.$(MFTYPE) $(WXDIR)\src\msw