source: golgotha/src/i4/test/dll_test/makefile.cc @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 14 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 5.6 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "stdmak.cc"
10#define I4 "../.."
11
12list files[10],linux_files[10],win95_files;
13list linux_libs,win95_libs,mac_libs,libs;
14list objs, cleans;
15list exename,exeopt;
16list pretext;
17
18list includes;
19list defines;
20list exe_base,dll;
21
22common()
23{
24  exe_base = "dll_test";
25  dll
26    + "test1.dll"
27    + "test2.dll"
28    ;
29
30  linux_files[0]
31    + I4 "/dll/linux_dll.cc"
32    ;
33
34  win95_files
35    + I4 "/dll/win32_dll.cc"
36    ;
37
38  includes
39    + I4
40    + I4 "/inc"
41    ;
42
43  files[0]
44    + "test.cc"
45    ;
46
47  files[1]
48    + "test1.cc"
49    ;
50
51  files[2]
52    + "test2.cc"
53    ;
54}
55
56void make_linux()
57//{{{
58{
59  list targets;
60
61  for (i=0; i<dll.size()+1; i++)
62    linux_files[i] += files[i];
63
64  exename = form("$(LTMP)/%s",exe_base[0]);
65
66  targets
67    + exename
68    + dll
69    ;
70
71  linux_libs
72    "dl"
73    ;
74
75  // linux
76  linux.cc.includes
77    + includes
78    ;
79
80  linux.cc.defines
81    + defines
82    ;
83
84  linux.cc_opt.includes = linux.cc.includes;
85  linux.cc_opt.defines = linux.cc.defines;
86
87  linux.link.libs
88    + linux_libs
89    ;
90
91  linux.linux.
92
93  use_unix_files();
94  makefile("Makefile");
95  echo(pretext);
96  echo(config);
97  linux.start();
98  target("all", targets);
99
100  linux.cc(linux_files[0],objs);
101  linux.link(objs,exename[0]);
102  cleans += objs;
103  linux.clean(cleans);
104}
105//}}}
106
107
108void make_win95(int bit_depth)
109//{{{
110{
111  win95_files += files;
112
113  win95_libs
114    + "$(MSDEV)/lib/kernel32.lib"
115    + "$(MSDEV)/lib/user32.lib"
116    + "$(MSDEV)/lib/gdi32.lib"
117    + "$(MSDEV)/lib/comdlg32.lib"
118    + "$(MSDEV)/lib/oldnames.lib"
119    + "$(MSDEV)/lib/msvcrt.lib"
120    + "$(MSDEV)/lib/winmm.lib"
121    + "$(MSDEV)/lib/dsound.lib"
122    + "$(MSDEV)/lib/d3drm.lib"
123    + "$(MSDEV)/lib/ddraw.lib"
124    ;
125
126  // dos
127  exename = form("$(DOSTMP)/%s_%d.exe",exe_base[0],bit_depth);
128  exeopt =  form("$(DOSTMP)/%so_%d.exe",exe_base[0],bit_depth);
129
130  win95.cc.win95_includes
131    + "$(MSDEV)/include"
132    ;
133
134  win95.cc_opt.win95_includes
135    + "$(MSDEV)/include"
136    ;
137
138  win95.cc.includes
139    + includes
140    ;
141
142  win95.cc_opt.includes
143    + includes
144    ;
145
146  win95.cc.defines
147    + defines
148    + form("I4_SCREEN_DEPTH=%d",bit_depth)
149    + "WIN32"
150    + "DEBUG"
151    + "_WINDOWS"
152    ;
153
154  win95.cc_opt.defines
155    + defines
156    + form("I4_SCREEN_DEPTH=%d",bit_depth)
157    + "WIN32"
158    + "_WIN32"
159    + "_WINDOWS"
160    ;
161
162  win95.link.libs
163    + win95_libs
164    ;
165
166  use_dos_files();
167  makefile(form("makefile_%d.mak",bit_depth));
168  echo(pretext);
169  echo(config);
170  win95.start();
171  target("all", exename);
172  target("opt", exeopt);
173  win95.cc(win95_files,objs);
174  win95.cc_opt(win95_files,opt_objs);
175  win95.link(objs,exename);
176  win95.link(opt_objs,exeopt);
177  win95.clean(objs + opt_objs);
178}
179//}}}
180
181
182void make_saturn()
183//{{{
184{
185  exename = form("$(DOSTMP)/%s",exe_base);
186  exeopt =  form("$(DOSTMP)/%so",exe_base);
187
188  saturn_files += files;
189
190  saturn.cc.defines
191    + "I4_SCREEN_DEPTH=15"
192    ;
193
194  saturn.cc.includes + includes;
195
196  //  generate Saturn dependencies
197
198  use_saturn_files();
199  makefile("makefile.sat");
200  echo(pretext);
201  echo(config);
202  saturn.start();
203
204  target("all", exename);
205  //  target("opt", exeopt);
206
207  saturn.cc(saturn_files,objs);
208  saturn.link(objs,exename);
209
210  //  saturn.cc_opt(saturn_filelist,opt_objs);
211  //  saturn.link(opt_objs,exeopt);
212  opt_objs.clear();
213
214  saturn.clean(objs + opt_objs);
215}
216//}}}
217
218
219void make_mac()
220//{{{
221{
222  list targets;
223
224  mac_files += files;
225
226  exename = form("\"%s.mac\"",exe_base[0]);
227  exeopt = form("\"%so.mac\"",exe_base[0]);
228
229  targets
230    + exename
231    ;
232
233  libs.clear();
234  libs
235    + "{SharedLibraries}InterfaceLib"
236    + "{SharedLibraries}MathLib"
237    + "{MWPPCLibraries}MWCRuntime.Lib"
238    + "{MWPPCLibraries}SIOUX.PPC.Lib"
239    + "{MWPPCLibraries}ANSI C.PPC.Lib"
240    + "{MWPPCLibraries}ANSI C++.PPC.Lib"
241    + "{Sprockets}lib:DrawSprocketLib"
242    + mac_libs
243    ;
244
245  mac.cc.mac_includes
246    + "{MacLinks}i4"
247    + "{Sprockets}inc"
248    ;
249
250  mac.cc.includes
251    + includes
252    ;
253
254  mac.cc.defines
255    + "__MAC__"
256    + "I4_SCREEN_DEPTH=15"
257    + defines
258    ;
259
260  mac.cc_opt.includes = mac.cc.mac_includes;
261  mac.cc_opt.includes = mac.cc.includes;
262  mac.cc_opt.defines = mac.cc.defines;
263
264  mac.link.libs
265    + libs
266    ;
267
268  use_mac_files();
269  makefile("makefile.make");
270  echo(pretext);
271  echo(config);
272  mac.start();
273  target("all", targets);
274  target("opt", exeopt);
275  mac.cc(mac_files,objs);
276  mac.cc_opt(mac_files,opt_objs);
277  mac.link(objs,exename);
278  mac.link(opt_objs,exeopt);
279  mac.clean(objs + opt_objs);
280}
281//}}}
282
283
284void main(int argc, char **argv)
285//{{{
286{
287  init();
288 
289  common();
290
291  if (argc<=1 || strcmp(argv[1], "linux")==0)
292    make_linux();
293  if (argc<=1 || strcmp(argv[1], "win95")==0 || strcmp(argv[1], "win96_16")==0)
294    make_win95(16);
295  if (argc==2 && strcmp(argv[1], "win95_15")==0)
296    make_win95(15);
297  if (argc<=1 || strcmp(argv[1], "mac")==0)
298    make_mac();
299  if (argc<=1 || strcmp(argv[1], "saturn")==0)
300    make_saturn();
301}
302//}}}
303
304
305//{{{ Emacs Locals
306// Local Variables:
307// folded-file: t
308// End:
309//}}}
Note: See TracBrowser for help on using the repository browser.