]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/watbase.t
Trim trailing spaces from key names when parsing
[wxWidgets.git] / distrib / msw / tmake / watbase.t
1 #!#############################################################################
2 #! File: wat.t
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
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 %wxCommon) {
16 next if $wxCommon{$file} !~ /\bB\b/;
17
18 $isCFile = $file =~ /\.c$/;
19 $file =~ s/cp?p?$/obj/;
20 $project{"WXCOMMONOBJS"} .= $file . " ";
21 $project{"WXCOBJS"} .= $file . " " if $isCFile;
22 }
23
24 foreach $file (sort keys %wxMSW) {
25 next if $wxMSW{$file} !~ /\bB\b/;
26
27 my $isCFile = $file =~ /\.c$/;
28 $file =~ s/cp?p?$/obj/;
29 $project{"WXMSWOBJS"} .= $file . " ";
30 $project{"WXCOBJS"} .= $file . " " if $isCFile;
31 }
32
33 foreach $file (sort keys %wxBase) {
34 my $isCFile = $file =~ /\.c$/;
35 $file =~ s/cp?p?$/obj/;
36 $project{"WXCOMMONOBJS"} .= $file . " ";
37 $project{"WXCOBJS"} .= $file . " " if $isCFile;
38 }
39
40 #$}
41 #! an attempt to embed '#' directly in the string somehow didn't work...
42 #$ $text = chr(35) . '!/binb/wmake.exe';
43
44 # This file was automatically generated by tmake
45 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WATBASE.T!
46
47 ##############################################################################
48 # Name: makebase.wat
49 # Purpose: Builds wxBase library for Watcom C++ under Win32
50 # Author: Vadim Zeitlin
51 # Created: 21.01.03
52 # RCS-ID: $Id$
53 # Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
54 # Licence: wxWindows licence
55 ##############################################################################
56
57 wxUSE_GUI=0
58
59 !include ..\makewat.env
60
61 LIBTARGET = $(WXDIR)\lib\wx$(TOOLKIT)$(DEBUGSUFFIX)_w.lib
62
63 EXTRATARGETS = zlib regex
64 EXTRATARGETSCLEAN = clean_zlib clean_regex
65 COMMDIR=$(WXDIR)\src\common
66 MSWDIR=$(WXDIR)\src\msw
67 OLEDIR=$(MSWDIR)\ole
68
69 COMMONOBJS = &
70 #$ ExpandGlue("WXCOMMONOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
71
72 MSWOBJS = &
73 #$ ExpandGlue("WXMSWOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
74
75 OBJECTS = $(COMMONOBJS) $(MSWOBJS)
76
77 SETUP_H=$(ARCHINCDIR)\wx\setup.h
78
79 all: $(SETUP_H) $(OUTPUTDIR) $(OBJECTS) $(LIBTARGET) $(EXTRATARGETS) .SYMBOLIC
80
81 $(ARCHINCDIR)\wx:
82 mkdir $(ARCHINCDIR)
83 mkdir $(ARCHINCDIR)\wx
84
85 $(OUTPUTDIR):
86 mkdir $(OUTPUTDIR)
87
88 $(SETUP_H): $(WXDIR)\include\wx\msw\setup.h $(ARCHINCDIR)\wx
89 copy $(WXDIR)\include\wx\msw\setup.h $@
90
91 LBCFILE=$(OUTPUTDIR)\wx$(TOOLKIT).lbc
92 $(LIBTARGET) : $(OBJECTS)
93 %create $(LBCFILE)
94 @for %i in ( $(OBJECTS) ) do @%append $(LBCFILE) +%i
95 wlib /q /b /c /n /p=512 $^@ @$(LBCFILE)
96
97
98 clean: .SYMBOLIC $(EXTRATARGETSCLEAN)
99 -erase $(OUTPUTDIR)\*.obj
100 -erase $(LIBTARGET)
101 -erase $(OUTPUTDIR)\*.pch
102 -erase $(OUTPUTDIR)\*.err
103 -erase $(OUTPUTDIR)\*.lbc
104
105 cleanall: clean
106 -erase $(LBCFILE)
107
108 #${
109 $_ = $project{"WXMSWOBJS"};
110 my @objs = split;
111 foreach (@objs) {
112 $text .= "\$(OUTPUTDIR)\\" . $_ . ': $(';
113 s/\.obj$//;
114 $text .= 'MSWDIR)\\';
115
116 my $suffix, $cc;
117 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
118 $suffix = "c";
119 $cc="CC";
120 $flags="CFLAGS";
121 }
122 else {
123 $suffix = "cpp";
124 $cc="CXX";
125 $flags="CXXFLAGS";
126 }
127 $text .= $_ . ".$suffix\n" .
128 " *\$($cc) \$($flags) \$<" . "\n\n";
129 }
130 #$}
131
132 ########################################################
133 # Common objects (always compiled)
134
135 #${
136 $_ = $project{"WXCOMMONOBJS"};
137 my @objs = split;
138 foreach (@objs) {
139 $text .= "\$(OUTPUTDIR)\\" . $_;
140 s/\.obj$//;
141 $text .= ': $(COMMDIR)\\';
142 my $suffix, $cc;
143 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
144 $suffix = "c";
145 $cc="CC";
146 $flags="CFLAGS";
147 }
148 else {
149 $suffix = "cpp";
150 $cc="CXX";
151 $flags="CXXFLAGS";
152 }
153 $text .= $_ . ".$suffix\n" .
154 " *\$($cc) \$($flags) \$<" . "\n\n";
155 }
156 #$}
157
158 zlib: .SYMBOLIC
159 cd $(WXDIR)\src\zlib
160 wmake -f makefile.wat all
161 cd $(WXDIR)\src\msw
162
163 clean_zlib: .SYMBOLIC
164 cd $(WXDIR)\src\zlib
165 wmake -f makefile.wat clean
166 cd $(WXDIR)\src\msw
167
168 regex: .SYMBOLIC
169 cd $(WXDIR)\src\regex
170 wmake -f makefile.wat all
171 cd $(WXDIR)\src\msw
172
173 clean_regex: .SYMBOLIC
174 cd $(WXDIR)\src\regex
175 wmake -f makefile.wat clean
176 cd $(WXDIR)\src\msw
177
178 MFTYPE=watbase
179 self : .SYMBOLIC $(WXDIR)\distrib\msw\tmake\filelist.txt $(WXDIR)\distrib\msw\tmake\$(MFTYPE).t
180 cd $(WXDIR)\distrib\msw\tmake
181 perl -S tmake -t $(MFTYPE) wxwin.pro -o makebase.wat
182 copy makebase.wat $(WXDIR)\src\msw