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 #$ ExpandGlue("WXCOMMONOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
95 MSWOBJS = #$ ExpandGlue("WXMSWOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
97 HTMLOBJS = #$ ExpandGlue("WXHTMLOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
99 # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
100 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) $(HTMLOBJS)
102 SETUP_H=$(ARCHINCDIR)\wx\setup.h
104 all: $(SETUP_H) $(OUTPUTDIR) $(OBJECTS) $(LIBTARGET) $(EXTRATARGETS) .SYMBOLIC
108 mkdir $(ARCHINCDIR)\wx
111 @if not exist $^@ mkdir $^@
113 $(SETUP_H): $(WXDIR)\include\wx\msw\setup.h $(ARCHINCDIR)\wx
114 copy $(WXDIR)\include\wx\msw\setup.h $@
116 LBCFILE=wx$(TOOLKIT).lbc
117 $(LIBTARGET) : $(OBJECTS)
119 @for %i in ( $(OBJECTS) ) do @%append $(LBCFILE) +%i
120 wlib /b /c /n $(LIBPAGESIZE) $^@ @$(LBCFILE)
123 clean: .SYMBOLIC $(EXTRATARGETSCLEAN)
133 $_ = $project{"WXMSWOBJS"};
136 $text .= "\$(OUTPUTDIR)\\" . $_ . ': $(';
138 if ( $project{"WXOLEOBJS"} =~ /\b\Q$_\E\b/ ) {
139 $text .= 'OLEDIR)\\';
141 $text .= 'MSWDIR)\\';
144 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
154 $text .= $_ . ".$suffix\n" .
155 " *\$($cc) \$($flags) \$<" . "\n\n";
159 ########################################################
160 # Common objects (always compiled)
163 $_ = $project{"WXCOMMONOBJS"};
166 $text .= "\$(OUTPUTDIR)\\" . $_;
168 $text .= ': $(COMMDIR)\\';
170 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
180 $text .= $_ . ".$suffix\n" .
181 " *\$($cc) \$($flags) \$<" . "\n\n";
185 ########################################################
186 # Generic objects (not always compiled, depending on
187 # whether platforms have native implementations)
190 $_ = $project{"WXGENERICOBJS"};
193 $text .= "\$(OUTPUTDIR)\\" . $_;
195 $text .= ': $(GENDIR)\\';
196 $text .= $_ . ".cpp\n" .
197 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
202 ########################################################
203 # HTML objects (always compiled)
206 $_ = $project{"WXHTMLOBJS"};
209 $text .= "\$(OUTPUTDIR)\\" . $_;
211 $text .= ': $(HTMLDIR)\\';
212 $text .= $_ . ".cpp\n" .
213 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
219 wmake -f makefile.wat all
224 wmake -f makefile.wat clean
229 wmake -f makefile.wat all
232 clean_zlib: .SYMBOLIC
234 wmake -f makefile.wat clean
239 wmake -f makefile.wat all
242 clean_jpeg: .SYMBOLIC
244 wmake -f makefile.wat clean
249 wmake -f makefile.wat all
252 clean_tiff: .SYMBOLIC
254 wmake -f makefile.wat clean
258 cd $(WXDIR)\src\regex
259 wmake -f makefile.wat all
262 clean_regex: .SYMBOLIC
263 cd $(WXDIR)\src\regex
264 wmake -f makefile.wat clean
268 self : .SYMBOLIC $(WXDIR)\distrib\msw\tmake\filelist.txt $(WXDIR)\distrib\msw\tmake\$(MFTYPE).t
269 cd $(WXDIR)\distrib\msw\tmake
270 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
271 copy makefile.$(MFTYPE) $(WXDIR)\src\msw