Add platform_libs to bmake to handle bcc64x mssdk libs
[MPC.git] / templates / bmake.mpd
blob8805c49e1fafe1c405f183f86da9a2cdcf595be8
1 #----------------------------------------------------------------------------
2 #       Borland Makefile
4 # This file was automatically generated by MPC.  Any changes made directly to
5 # this file will be lost the next time it is generated.
7 #----------------------------------------------------------------------------
8 <%marker(top)%>
9 <%foreach(compilers)%>
10 !ifdef <%normalize(uc(compiler))%>
11 CC = <%cc%>
12 OPTIMIZE_CFLAGS = <%optimize_flags%>
13 PDB_FLAGS = <%pdb_flags%>
14 DEBUG_CFLAGS = <%debug_flags%>
15 RELEASE_CFLAGS = <%release_flags%>
16 CC_CFLAGS = <%ccflags%>
17 STACK_LFLAG = <%stack_flag%>
18 WARN_FLAGS = <%warn_flags%>
19 BINARY_FLAGS = <%binary_flags%>
20 THREAD_FLAGS = <%thr_flags%>
21 LIB_EXT = <%lib_ext%>
22 COMMON_DEFINES =<%foreach(common_defines)%> -D<%common_define%><%endfor%>
23 COMMON_FLAGS = <%foreach(common_flags)%><%common_flag%><%endfor%>
24 PLATFORM_LIBS_PREFIX = <%platform_libs_prefix%>
25 OBJ_EXT = <%obj_ext%>
26 LINKER_PATHS = <%linker_paths%>
27 STARTUP_BITS = <%startup_bits%>
28 LINK = <%link%>
29 COMMON_LIBS = <%common_libs%>
30 DLLLIBS = <%dll_libs%>
31 EXELIBS = <%exe_libs%>
32 TLIB = <%tlib%>
33 DLLFLAGS = <%dllflags%>
34 <%if(pch)%>PCH = 1<%endif%>
35 <%if(objectsearchpath)%>
36 OBJECTSEARCHPATH = \
37 <%foreach(libpaths)%>
38    -j"<%libpath%>"<%fornotlast(" \\")%>
39 <%endfor%>
40 <%endif%>
41 EXEFLAGS = <%exeflags%>
42 LINKER_DLL_ARGUMENTS = <%linker_dll_arguments%>
43 LINKER_EXE_ARGUMENTS = <%linker_exe_arguments%>
44 !else
45 <%endfor%>
46 !error You must select one of these compilers:<%foreach(compilers)%> <%normalize(uc(compiler))%><%endfor%>
47 <%foreach(compilers)%>
48 !endif
49 <%endfor%>
51 <%foreach(configurations)%>
52 !ifdef <%normalize(uc(configuration))%>
53 OCFLAGS = <%if(optimize)%>$(OPTIMIZE_CFLAGS) <%else%><%if(debug_prj)%>$(DEBUG_CFLAGS)<%foreach(debug_macros)%> -D<%debug_macro%><%endfor%><%endif%><%endif%><%foreach(defines)%> -D<%define%><%endfor%><%if(!debug_prj)%> $(RELEASE_CFLAGS)<%endif%>
54 LFLAGS =<%if(debug_prj)%> $(PDB_FLAGS)<%endif%>
55 CFG_DIR = <%intermediate_dir%>\\
56 LIBMODIFIER = <%if(use_lib_modifier)%><%lib_modifier%><%endif%>
57 EXEMODIFIER = <%if(use_exe_modifier)%><%lib_modifier%><%endif%>
58 <%if(type_is_static)%>
59 STATIC_CFG = 1
60 <%endif%>
61 <%if(type_is_static || need_staticflags)%>
62 <%if(staticflags)%>
63 STATIC_FLAGS =<%foreach(staticflags)%> -D<%staticflag%><%endfor%>
64 <%endif%>
65 <%else%>
66 <%if(dynamicflags)%>
67 DYN_FLAGS =<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%>
68 <%endif%>
69 <%endif%>
70 <%if(postlinkrmext)%>
71 POSTLINKRM = <%postlinkrmext%>
72 <%endif%>
73 <%if(exename)%>
74 EXEOUTPUTDIR = <%if(exeout)%><%exeout%><%if(windows_style)%>\<%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%>\\
75 <%endif%>
76 !else
77 <%endfor%>
78 !error You must define one of these valid configurations:<%foreach(configurations)%> <%normalize(uc(configuration))%><%endfor%>
79 <%foreach(configurations)%>
80 !endif
81 <%endfor%>
83 !ifdef UNICODE
84 UC_CFLAGS    = <%unicode_flags%>
85 UNICODE_DIR  = Unicode\\
86 UC_MAIN      = w
87 ULIBMODIFIER = <%unicode_lib_modifier%>
88 UEXEMODIFIER = <%unicode_lib_modifier%>
89 !endif
91 !ifdef CODEGUARD
92 CG_CFLAGS = -vG
93 CG_LIB    = cg32.lib
94 !endif
96 DLL_EXT      = <%dll_ext%>
97 EXE_EXT      = <%exe_ext%>
98 RC           = <%rc%>
99 LIBFLAGS     = <%libflags%>
100 CCFLAGS      = $(CC_CFLAGS)<%if(type_is_binary)%> $(BINARY_FLAGS)<%endif%><%if(compile_flags)%> <%compile_flags%><%endif%>
102 <%if(use_vcl)%>
103 STARTUP_LETTER = <%if(exename)%>w<%else%><%startup_letter%><%endif%>
104 <%else%>
105 VCL_CFLAGS     = -D_NO_VCL
106 STARTUP_LETTER = <%startup_letter%>
107 <%endif%>
108 STARTUP_OBJ    = c0$(STARTUP_LETTER)$(STARTUP_BITS)$(UC_MAIN)$(OBJ_EXT)
110 INTERMEDIATE = $(CFG_DIR)$(UNICODE_DIR)<%noextension(project_name)%>
111 <%if(exename)%>
112 NAME         = <%exename%>$(EXEMODIFIER)
113 <%else%>
114 <%if(sharedname)%>
115 NAME         = <%libname_prefix%><%sharedname%>$(LIBMODIFIER)$(ULIBMODIFIER)
116 <%else%>
117 <%if(staticname)%>
118 NAME         = <%libname_prefix%><%staticname%>$(LIBMODIFIER)$(ULIBMODIFIER)
119 <%endif%>
120 <%endif%>
121 <%endif%>
122 CPPDIR       = <%cppdir%>
123 RESDIR       = <%rcdir%>
124 <%if(exename || sharedname || staticname)%>
126 OBJFILES = \
127 <%foreach(source_files)%>
128            "$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)"<%fornotlast(" \\")%>
129 <%endfor%>
130 <%endif%>
131 <%if(libpaths)%>
133 LFLAGS   = \
134            $(LFLAGS) \
135            $(LINKER_PATHS) \
136 <%if(debug_prj)%>
137            -v \
138            -r \
139 <%endif%>
140 <%if(linkflags)%>
141         <%linkflags%> \
142 <%endif%>
143 <%if(StackReserveSize)%>
144            $(STACK_LFLAG)<%StackReserveSize%> \
145 <%endif%>
146 <%if(StackCommitSize)%>
147            /Sc:<%StackCommitSize%> \
148 <%endif%>
149 <%if(!optimize)%>
150            -v<%if(libpaths)%> \<%endif%>
151 <%endif%>
152 <%foreach(libpaths)%>
153            -L"<%libpath%>" \
154 <%endfor%>
155            $(OBJECTSEARCHPATH)
156 <%endif%>
158 LIBFILES = \
159 <%foreach(reverse(libs))%>
160            <%libname_prefix%><%lib%>$(LIBMODIFIER)$(ULIBMODIFIER)$(LIB_EXT) \
161 <%endfor%>
162 <%foreach(reverse(lit_libs))%>
163            <%lit_lib%>$(LIB_EXT) \
164 <%endfor%>
165 <%foreach(reverse(platform_libs))%>
166            $(PLATFORM_LIBS_PREFIX)<%platform_libs%> \
167 <%endfor%>
168 <%foreach(reverse(pure_libs))%>
169            <%pure_lib%> \
170 <%endfor%>
171            $(COMMON_LIBS)
173 <%if(resource_files)%>
175 !ifndef STATIC_CFG
176 RESOURCE = \
177 <%foreach(resource_files)%>
178            $(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res<%fornotlast(" \\")%>
179 <%endfor%>
180 <%if(includes)%>
182 RC_FLAGS = \
183 <%foreach(includes)%>
184         -i"<%include%>"<%fornotlast(" \\")%>
185 <%endfor%>
186 <%endif%>
187 !endif
188 <%endif%>
190 <%if(pch_header)%>
191 # Set NO_USE_PCH if you do not want to use precompiled headers.
192 !ifndef NO_USE_PCH
193 !ifdef PCH
194 PCH_CFLAGS = <%foreach(pch_defines)%>-D<%pch_define%> <%endfor%>-H=$(INTERMEDIATE)\<%noextension(project_name)%>.csm -Hh=<%pch_header%>
195 !endif
196 !endif
197 <%endif%>
199 CFLAGS = \
200 <%foreach(cflags)%>
201          <%cflag%> \
202 <%endfor%>
203          $(COMMON_FLAGS) \
204          $(COMMON_DEFINES) \
205 <%foreach(macros common_defines)%>
206          -D<%macro%> \
207 <%endfor%>
208 <%foreach(includes)%>
209          -I"<%include%>" \
210 <%endfor%>
211          $(PCH_CFLAGS) \
212          $(VCL_CFLAGS)
214 <%marker(macros)%>
215 <%if(exename)%>
216 OUTPUTDIR = $(EXEOUTPUTDIR)
217 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(EXE_EXT)<%if(postbuild)%> __postbuild__<%endif%>
219 $(OUTPUTDIR)$(NAME)$(EXE_EXT): $(OBJFILES) $(RESOURCE)
220   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
221 <%if(prelink)%>
222   <%eval(prelink)%>
223 <%endif%>
224   $(LINK) @&&!
225   $(LINKER_EXE_ARGUMENTS)
228 <%endif%>
229 <%if(sharedname)%>
230 !ifndef STATIC_CFG
231 OUTPUTDIR = <%if(dllout)%><%dllout%><%else%><%libout%><%endif%>\\
232 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(DLL_EXT)<%if(postbuild)%> __postbuild__<%endif%>
234 $(OUTPUTDIR)$(NAME)$(DLL_EXT): $(OBJFILES) $(RESOURCE)
235   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
236 <%if(prelink)%>
237   <%eval(prelink)%>
238 <%endif%>
239   $(LINK) @&&!
240   $(LINKER_DLL_ARGUMENTS)
242 !endif
244 <%endif%>
245 <%if(staticname)%>
246 !ifdef STATIC_CFG
247 OUTPUTDIR = <%libout%>\\
248 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(LIB_EXT)<%if(postbuild)%> __postbuild__<%endif%>
250 $(OUTPUTDIR)$(NAME)$(LIB_EXT): $(OBJFILES)
251   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
252   $(TLIB) $(LIBFLAGS) $(OUTPUTDIR)$(NAME)$(LIB_EXT) @&&!
253 + $(**: = &^
254 + )
256 !endif
258 <%endif%>
259 <%if(!exename && !sharedname && !staticname)%>
260 all:<%if(prebuild)%> __prebuild__<%endif%><%if(postbuild)%> __postbuild__<%endif%>
261   @-rem
263 <%endif%>
264 <%if(custom_types)%>
265 GENERATED_DIRTY =<%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%><%endif%><%endfor%><%endfor%>
266 <%foreach(custom_types)%>
267 <%if(custom_type->libpath)%>
268 PATH = $(PATH);<%custom_type->libpath%>
269 <%endif%>
270 <%foreach(custom_type->input_files)%>
271 <%if(custom_type->input_file->output_files)%>
272 <%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%fornotlast(" ")%><%endfor%>: <%custom_type->input_file%><%if(custom_type->input_file->dependencies)%> <%custom_type->input_file->dependencies%><%endif%>
273 <%if(flag_overrides(custom_type->input_file, gendir))%>
274         @if not exist "<%flag_overrides(custom_type->input_file, gendir)%>" mkdir "<%flag_overrides(custom_type->input_file, gendir)%>"
275 <%endif%>
276   <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%if(custom_type->output_option)%><%custom_type->input_file%> <%custom_type->output_option%> $@<%else%><%custom_type->input_file%><%endif%>
277 <%if(flag_overrides(custom_type->input_file, postcommand))%>
278 <%foreach(custom_type->input_file)%>
279   <%flag_overrides(custom_type->input_file, postcommand)%>
280 <%endfor%>
281 <%else%>
282 <%if(custom_type->postcommand)%>
283 <%foreach(custom_type->input_file)%>
284   <%custom_type->postcommand%>
285 <%endfor%>
286 <%endif%>
287 <%endif%>
288 <%if(pch_header)%>
289 <%if(custom_type->pch_postrule)%>
290 <%foreach(custom_type->input_file->source_output_files)%>
291   @echo \#include "<%pch_header%>" > temporary.src
292   @type <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%> >> temporary.src
293   @move /y temporary.src <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>
294 <%endfor%>
295 <%endif%>
296 <%endif%>
298 <%endif%>
299 <%endfor%>
300 <%endfor%>
301 <%if(exename || sharedname || staticname)%>
302 <%if(source_files)%>
303 $(OBJFILES): $(GENERATED_DIRTY)
304 <%else%>
305 all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
306 <%endif%>
307 <%else%>
308 all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
309 <%endif%>
311 <%endif%>
312 generated: $(GENERATED_DIRTY)
313   @-rem
315 .path$(OBJ_EXT) = $(INTERMEDIATE)
317 .path.cpp = $(CPPDIR)
318 .cpp$(OBJ_EXT):
319   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
320         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
322 .path.cxx = $(CPPDIR)
323 .cxx$(OBJ_EXT):
324   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
325         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
327 .path.cc = $(CPPDIR)
328 .cc$(OBJ_EXT):
329   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
330         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
332 .path.C = $(CPPDIR)
333 .C$(OBJ_EXT):
334   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
335         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
337 .path.c = $(CPPDIR)
338 .c$(OBJ_EXT):
339   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
340         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
342 <%foreach(source_files)%>
343 <%if(transdir(source_file) || flag_overrides(source_file, buildflags))%>
344 "$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)":
345   @if not exist "$(INTERMEDIATE)\<%transdir(source_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(source_file)%>"
346   $(CC) <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) <%source_file%>
347 <%endif%>
348 <%endfor%>
349 <%if(resource_files)%>
350 !ifndef STATIC_CFG
351 .path.res = $(INTERMEDIATE)
352 .path.rc = $(RESDIR)
353 .rc.res:
354   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
355         $(RC) $(RC_FLAGS) -fo$@ $<
356 <%foreach(resource_files)%>
357 <%if(transdir(resource_file))%>
358 "$(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res":
359   @if not exist "$(INTERMEDIATE)\<%transdir(resource_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(resource_file)%>"
360   $(RC) -fo$@ <%resource_file%>
361 <%endif%>
362 <%endfor%>
363 !endif
365 <%endif%>
366 clean:
367         @if exist "$(INTERMEDIATE)" rmdir /s/q $(INTERMEDIATE)
369 realclean: clean
370 <%foreach(custom_types)%>
371 <%foreach(custom_type->input_files)%>
372 <%if(custom_type->input_file->output_files)%>
373 <%foreach(custom_type->input_file->output_files)%>
374 <%if(flag_overrides(custom_type->input_file, gendir))%>
375         @del "<%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%>" 2>NUL
376 <%else%>
377         @del "<%custom_type->input_file->output_file%>" 2>NUL
378 <%endif%>
379 <%endfor%>
380 <%endif%>
381 <%endfor%>
382 <%endfor%>
383 <%if(exename)%>
384         @del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" 2>NUL
385 <%else%>
386 <%if(sharedname)%>
387         @del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" 2>NUL
388 <%endif%>
389 <%if(staticname)%>
390         @del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" 2>NUL
391 <%endif%>
392 <%endif%>
393 <%if(exename || sharedname || staticname)%>
394         @del "$(OUTPUTDIR)$(NAME)$(POSTLINKRM)" 2>NUL
395 <%endif%>
396 <%if(postclean)%>
397   -<%eval(postclean)%>
398 <%endif%>
400 <%if(prebuild)%>
401 __prebuild__:
402   @<%eval(prebuild)%>
404 <%endif%>
405 <%if(postbuild)%>
406 __postbuild__:
407   @<%eval(postbuild)%>
409 <%endif%>
410 <%marker(local)%>
411 <%marker(bottom)%>