]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/v15.t
29f9b09732290f302316f6a9df704da32ff2c88b
[wxWidgets.git] / distrib / msw / tmake / v15.t
1 #!#############################################################################
2 #! File: v15.t
3 #! Purpose: tmake template file for wxWindows makefile for VC++ 1.52, generate
4 #! the makefile by executing the following command:
5 #! tmake -t v15 wxwin.pro -o Makefile
6 #! Author: Vadim Zeitlin
7 #! Created: 16.12.99
8 #! Version: $Id$
9 #!#############################################################################
10 #${
11 #! include the code which parses filelist.txt file and initializes
12 #! %wxCommon, %wxGeneric and %wxMSW hashes.
13 IncludeTemplate("filelist.t");
14
15 #! because we later search for " <filename> " in this string, it should
16 #! start with space
17 $project{"WXCOBJS"} = " ";
18
19 #! now transform these hashes into $project tags
20 foreach $file (sort keys %wxGeneric) {
21 if ( $wxGeneric{$file} =~ /\b(PS|G|U)\b/ ) {
22 #! this file for some reason wasn't compiled for VC++ 1.52
23 next unless $file =~ /^prntdlgg\./;
24 }
25
26 $file =~ s/cp?p?$/obj/;
27 $project{"WXGENERICOBJS"} .= $file . " "
28 }
29
30 foreach $file (sort keys %wxCommon) {
31 #! socket files don't compile under Win16 currently
32 next if $wxCommon{$file} =~ /\b(32|S|U)\b/;
33
34 $isCFile = $file =~ /\.c$/;
35 $file =~ s/cp?p?$/obj/;
36 $obj = $file . " ";
37 #! have to split lib in 2 halves because otherwise it's too big
38 $project{$file =~ "^[a-o]" ? "WXCOMMONOBJS1" : "WXCOMMONOBJS2"} .= $obj;
39 $project{"WXCOBJS"} .= $obj if $isCFile;
40 }
41
42 foreach $file (sort keys %wxMSW) {
43 #! don't take files not appropriate for 16-bit Windows
44 next if $wxMSW{$file} =~ /\b(32|O)\b/;
45
46 $isCFile = $file =~ /\.c$/;
47 $file =~ s/cp?p?$/obj/;
48 $obj = $file . " ";
49 #! have to split lib in 2 halves because otherwise it's too big
50 $project{$file =~ "^[a-o]" ? "WXMSWOBJS1" : "WXMSWOBJS2"} .= $obj;
51 $project{"WXCOBJS"} .= $obj if $isCFile;
52 }
53 #$}
54 # This file was automatically generated by tmake
55 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T!
56
57 # this is needed because my usual 4NT doesn't work well when invoked from
58 # makefile
59 COMSPEC=$(SYSTEMROOT)\system32\cmd.exe
60
61 DEBUG=1
62
63 WXDIR=..
64 TMAKE_DIR=$(WXDIR)\distrib\msw\tmake
65
66 TMAKE=E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake
67
68 .SUFFIXES :
69
70 # set up the compiler options
71 INCLUDE=/I. /I$(WXDIR)\include /I$(INCLUDE)
72 DEFINES=-D__WXMSW__ -D__WINDOWS__
73
74 # compile in large memory model
75 CFLAGS=$(CFLAGS) /nologo /W4 /AL
76
77 !ifdef DEBUG
78 CFLAGS=$(CFLAGS) /Zi /Z7
79 DEFINES=$(DEFINES) /D__WXDEBUG__
80 !endif
81
82 CFLAGS=$(CFLAGS) $(INCLUDE) $(DEFINES)
83 CPPFLAGS=$(CFLAGS)
84
85 PCH_CREATE=/Ycwx/wxprec.h /Fpwx.pch
86 PCH_USE=/Yuwx/wxprec.h /Fpwx.pch
87
88 # the targets
89 WXLIB=wx.lib
90
91 # we can't have all objects in one list because the library becomes too big
92 COMMONOBJS1= #$ ExpandList("WXCOMMONOBJS1");
93 COMMONOBJS2= #$ ExpandList("WXCOMMONOBJS2");
94 GENERICOBJS= #$ ExpandList("WXGENERICOBJS");
95 MSWOBJS1= #$ ExpandList("WXMSWOBJS1");
96 MSWOBJS2= #$ ExpandList("WXMSWOBJS2");
97
98 OBJECTS=$(COMMONOBJS1) $(COMMONOBJS2) $(GENERICOBJS) $(MSWOBJS1) $(MSWOBJS2)
99
100 # the rules
101 all: Makefile $(WXLIB)
102
103 $(WXLIB) : pch $(OBJECTS)
104
105 clean:
106 -del *.obj *.pch
107
108 pch: wx/msw/setup.h dummy.obj
109
110 dummy.obj: $(WXDIR)/src/msw/dummy.cpp
111 $(CPP) $(CPPFLAGS) $(PCH_CREATE) /c /Tp $?
112
113 #${
114 sub generate_rules_for_dir
115 {
116 my $dir = $_[0];
117 $_ = $_[1];
118 my @objs = split;
119
120 foreach (@objs) {
121 my $isC = $project{"WXCOBJS"} =~ / \Q$_\E /;
122 my $name = $_;
123 $name =~ s/.obj$//;
124 my $suffix = $isC ? "c" : "cpp";
125 my $cc = $isC ? '$(CC)' : '$(CPP)';
126 my $flags = $isC ? '$(CFLAGS)' : '$(CPPFLAGS) $(PCH_USE)';
127 $text .= "$name.obj: \$(WXDIR)/src/$dir/$name.$suffix\n" .
128 "\t $cc $flags /c /Tp \$?\n"
129 }
130 }
131
132 &generate_rules_for_dir("msw", $project{"WXMSWOBJS1"} . $project{"WXMSWOBJS2"});
133 $text .= "\n";
134 &generate_rules_for_dir("common", $project{"WXCOMMONOBJS1"} . $project{"WXCOMMONOBJS2"});
135 $text .= "\n";
136 &generate_rules_for_dir("generic", $project{"WXGENERICOBJS"});
137 #$}
138
139 Makefile: $(TMAKE_DIR)\makefile.v15
140 copy $? Makefile
141
142 $(TMAKE_DIR)\makefile.v15: $(TMAKE_DIR)\filelist.txt $(TMAKE_DIR)\v15.t
143 cd $(TMAKE_DIR)
144 $(TMAKE) -t v15 wxwin.pro -o makefile.v15