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 #! Changelist: 2003-02-25 - Juergen Ulbts - update from wxWindows 2.5.x/HEAD branch
9 #!#############################################################################
11 #! include the code which parses filelist.txt file and initializes
12 #! %wxCommon, %wxGeneric and %wxMSW hashes.
13 IncludeTemplate("filelist.t");
15 #! now transform these hashes into $project tags
16 foreach $file (sort keys %wxGeneric) {
18 if ( $wxGeneric{$file} =~ /\b(PS|G|16|U)\b/ ) {
19 $tag = "WXNONESSENTIALOBJS";
22 $tag = "WXGENERICOBJS";
25 $file =~ s/cp?p?$/obj/;
26 $project{$tag} .= $file . " "
29 foreach $file (sort keys %wxHTML) {
30 next if $wxHTML{$file} =~ /\b16\b/;
32 $file =~ s/cp?p?$/obj/;
33 $project{"WXHTMLOBJS"} .= $file . " "
36 foreach $file (sort keys %wxCommon) {
37 next if $wxCommon{$file} =~ /\b(16|U)\b/;
39 $isCFile = $file =~ /\.c$/;
40 $file =~ s/cp?p?$/obj/;
41 $project{"WXCOMMONOBJS"} .= $file . " ";
42 $project{"WXCOBJS"} .= $file . " " if $isCFile;
45 foreach $file (sort keys %wxMSW) {
46 #! these files don't compile
47 next if $file =~ /^pnghand\./;
49 next if $wxMSW{$file} =~ /\b16\b/;
51 my $isOleObj = $wxMSW{$file} =~ /\bO\b/;
52 my $isCFile = $file =~ /\.c$/;
53 $file =~ s/cp?p?$/obj/;
54 $project{"WXMSWOBJS"} .= $file . " ";
55 $project{"WXCOBJS"} .= $file . " " if $isCFile;
56 $project{"WXOLEOBJS"} .= $file . " " if $isOleObj
59 #! an attempt to embed '#' directly in the string somehow didn't work...
60 #$ $text = chr(35) . '!/binb/wmake.exe';
62 # This file was automatically generated by tmake
63 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
67 # Author: Julian Smart
70 # Makefile : Builds wxWindows library for Watcom C++, WIN32
71 !include ..\makewat.env
73 LIBTARGET = $(WXDIR)\lib\$(LIBNAME).lib
75 EXTRATARGETS = png zlib jpeg tiff regex
76 EXTRATARGETSCLEAN = clean_png clean_zlib clean_jpeg clean_tiff clean_regex
77 GENDIR=$(WXDIR)\src\generic
78 COMMDIR=$(WXDIR)\src\common
79 JPEGDIR=$(WXDIR)\src\jpeg
80 TIFFDIR=$(WXDIR)\src\tiff
81 MSWDIR=$(WXDIR)\src\msw
83 HTMLDIR=$(WXDIR)\src\html
85 DOCDIR = $(WXDIR)\docs
87 GENERICOBJS= #$ ExpandGlue("WXGENERICOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
89 # These are generic things that don't need to be compiled on MSW,
90 # but sometimes it's useful to do so for testing purposes.
91 NONESSENTIALOBJS= #$ ExpandGlue("WXNONESSENTIALOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
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): $(ARCHINCDIR)\wx
115 if not exist $(WXDIR)\include\wx\msw\setup.h copy $(WXDIR)\include\wx\msw\setup0.h $(WXDIR)\include\wx\msw\setup.h
116 copy $(WXDIR)\include\wx\msw\setup.h $@
118 LBCFILE=wx$(TOOLKIT).lbc
119 $(LIBTARGET) : $(OBJECTS)
121 @for %i in ( $(OBJECTS) ) do @%append $(LBCFILE) +%i
122 wlib /b /c /n $(LIBPAGESIZE) $^@ @$(LBCFILE)
125 clean: .SYMBOLIC $(EXTRATARGETSCLEAN)
135 $_ = $project{"WXMSWOBJS"};
138 $text .= "\$(OUTPUTDIR)\\" . $_ . ': $(';
140 if ( $project{"WXOLEOBJS"} =~ /\b\Q$_\E\b/ ) {
141 $text .= 'OLEDIR)\\';
143 $text .= 'MSWDIR)\\';
146 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
156 $text .= $_ . ".$suffix\n" .
157 " *\$($cc) \$($flags) \$<" . "\n\n";
161 ########################################################
162 # Common objects (always compiled)
165 $_ = $project{"WXCOMMONOBJS"};
168 $text .= "\$(OUTPUTDIR)\\" . $_;
170 $text .= ': $(COMMDIR)\\';
172 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
182 $text .= $_ . ".$suffix\n" .
183 " *\$($cc) \$($flags) \$<" . "\n\n";
188 ########################################################
189 # Generic objects (not always compiled, depending on
190 # whether platforms have native implementations)
193 $_ = $project{"WXGENERICOBJS"};
196 $text .= "\$(OUTPUTDIR)\\" . $_;
198 $text .= ': $(GENDIR)\\';
199 $text .= $_ . ".cpp\n" .
200 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
205 ########################################################
206 # HTML objects (always compiled)
209 $_ = $project{"WXHTMLOBJS"};
212 $text .= "\$(OUTPUTDIR)\\" . $_;
214 $text .= ': $(HTMLDIR)\\';
215 $text .= $_ . ".cpp\n" .
216 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
222 wmake -f makefile.wat all
227 wmake -f makefile.wat clean
232 wmake -f makefile.wat all
235 clean_zlib: .SYMBOLIC
237 wmake -f makefile.wat clean
242 wmake -f makefile.wat all
245 clean_jpeg: .SYMBOLIC
247 wmake -f makefile.wat clean
252 wmake -f makefile.wat all
255 clean_tiff: .SYMBOLIC
257 wmake -f makefile.wat clean
261 cd $(WXDIR)\src\regex
262 wmake -f makefile.wat all
265 clean_regex: .SYMBOLIC
266 cd $(WXDIR)\src\regex
267 wmake -f makefile.wat clean
271 self : .SYMBOLIC $(WXDIR)\distrib\msw\tmake\filelist.txt $(WXDIR)\distrib\msw\tmake\$(MFTYPE).t
272 cd $(WXDIR)\distrib\msw\tmake
273 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
274 copy makefile.$(MFTYPE) $(WXDIR)\src\msw