]> git.saurik.com Git - wxWidgets.git/blame - distrib/msw/tmake/v15.t
Committing in .
[wxWidgets.git] / distrib / msw / tmake / v15.t
CommitLineData
7521ca7d
VZ
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)\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 at #$ Now()
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
59COMSPEC=$(SYSTEMROOT)\system32\cmd.exe
60
61DEBUG=1
62
63WXDIR=..
64TMAKE_DIR=$(WXDIR)\distrib\msw\tmake
65
66TMAKE=E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake
67
68.SUFFIXES :
69
70# set up the compiler options
71INCLUDE=/I. /I$(WXDIR)\include /I$(INCLUDE)
72DEFINES=-D__WXMSW__ -D__WINDOWS__
73
74# compile in large memory model
75CFLAGS=$(CFLAGS) /nologo /W4 /AL
76
77!ifdef DEBUG
78CFLAGS=$(CFLAGS) /Zi /Z7
79DEFINES=$(DEFINES) /D__WXDEBUG__
80!endif
81
82CFLAGS=$(CFLAGS) $(INCLUDE) $(DEFINES)
83CPPFLAGS=$(CFLAGS)
84
85PCH_CREATE=/Ycwx/wxprec.h /Fpwx.pch
86PCH_USE=/Yuwx/wxprec.h /Fpwx.pch
87
88# the targets
89WXLIB=wx.lib
90
91# we can't have all objects in one list because the library becomes too big
92COMMONOBJS1= #$ ExpandList("WXCOMMONOBJS1");
93COMMONOBJS2= #$ ExpandList("WXCOMMONOBJS2");
94GENERICOBJS= #$ ExpandList("WXGENERICOBJS");
95MSWOBJS1= #$ ExpandList("WXMSWOBJS1");
96MSWOBJS2= #$ ExpandList("WXMSWOBJS2");
97
98OBJECTS=$(COMMONOBJS1) $(COMMONOBJS2) $(GENERICOBJS) $(MSWOBJS1) $(MSWOBJS2)
99
100# the rules
101all: Makefile $(WXLIB)
102
103$(WXLIB) : pch $(OBJECTS)
104
105clean:
106 -del *.obj *.pch
107
108pch: wx/msw/setup.h dummy.obj
109
110dummy.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
139Makefile: $(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