Mon Aug 19 07:22:20 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl>
[MPC.git] / templates / bmake.mpd
blob536e65ea9beb52936a51d902cceb5b8dadd6d0bd
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(configurations)%>
10 !ifdef <%normalize(uc(configuration))%>
11 OCFLAGS32    = <%if(optimize)%>-O2<%else%><%if(debug_prj)%>-v -y -Od -vi- -k<%foreach(debug_macros)%> -D<%debug_macro%><%endfor%><%endif%><%endif%><%foreach(defines)%> -D<%define%><%endfor%>
12 OCFLAGS64    = <%if(optimize)%>-O2<%else%><%if(debug_prj)%>-O3 <%foreach(debug_macros)%> -D<%debug_macro%><%endfor%><%endif%><%endif%><%foreach(defines)%> -D<%define%><%endfor%>
13 CFG_DIR      = <%intermediate_dir%>\\
14 LIBMODIFIER  = <%if(use_lib_modifier)%><%lib_modifier%><%endif%>
15 EXEMODIFIER  = <%if(use_exe_modifier)%><%lib_modifier%><%endif%>
16 <%if(type_is_static)%>
17 STATIC_CFG   = 1
18 <%endif%>
19 <%if(type_is_static || need_staticflags)%>
20 <%if(staticflags)%>
21 STATIC_FLAGS =<%foreach(staticflags)%> -D<%staticflag%><%endfor%>
22 <%endif%>
23 <%else%>
24 <%if(dynamicflags)%>
25 DYN_FLAGS    =<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%>
26 <%endif%>
27 <%endif%>
28 <%if(postlinkrmext)%>
29 POSTLINKRM   = <%postlinkrmext%>
30 <%endif%>
31 <%if(exename)%>
32 EXEOUTPUTDIR = <%if(exeout)%><%exeout%><%if(windows_style)%>\<%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%>\\
33 <%endif%>
34 !else
35 <%endfor%>
36 !error You must define one of these valid configurations:<%foreach(configurations)%> <%normalize(uc(configuration))%><%endfor%>
37 <%foreach(configurations)%>
38 !endif
39 <%endfor%>
41 !ifdef UNICODE
42 UC_CFLAGS    = <%unicode_flags%>
43 UNICODE_DIR  = Unicode\\
44 UC_MAIN      = w
45 ULIBMODIFIER = <%unicode_lib_modifier%>
46 UEXEMODIFIER = <%unicode_lib_modifier%>
47 !endif
49 !ifdef CODEGUARD
50 CG_CFLAGS = -vG
51 CG_LIB    = cg32.lib
52 !endif
54 <%if(build64bit)%>
55 OBJ_EXT      = <%obj64_ext%>
56 <%else%>
57 OBJ_EXT      = <%obj32_ext%>
58 <%endif%>
60 <%if(use_vcl)%>
61 STARTUP_LETTER = <%if(exename)%>w<%else%><%startup_letter%><%endif%>
62 <%else%>
63 VCL_CFLAGS     = -D_NO_VCL
64 STARTUP_LETTER = <%startup_letter%>
65 <%endif%>
66 <%if(build64bit)%>
67 STARTUP_BITS   = 64
68 <%else%>
69 STARTUP_BITS   = 32
70 <%endif%>
71 STARTUP_OBJ    = c0$(STARTUP_LETTER)$(STARTUP_BITS)$(UC_MAIN)$(OBJ_EXT)
73 DLL_EXT      = <%dll_ext%>
74 <%if(build64bit)%>
75 LIB_EXT      = <%lib64_ext%>
76 <%else%>
77 LIB_EXT      = <%lib32_ext%>
78 <%endif%>
79 EXE_EXT      = <%exe_ext%>
80 CC32         = <%cc32%>
81 RC32         = <%rc32%>
82 LINK32       = <%link32%>
83 CC64         = <%cc64%>
84 RC64         = <%rc64%>
85 LINK64       = <%link64%>
86 TLIB         = <%tlib%>
87 THREADFLAGS  = <%thflags%>
88 DLLFLAGS     = <%dllflags%>
89 LIBFLAGS     = <%libflags%>
90 EXEFLAGS     = <%exeflags%>
91 WARNFLAGS32  = <%warnflags32%>
92 WARNFLAGS64  = <%warnflags64%>
93 CCFLAGS      = <%ccflags%><%if(type_is_binary)%> <%binary_compile_flags("-tWR -tWD")%><%endif%><%if(compile_flags)%> <%compile_flags%><%endif%>
95 INTERMEDIATE = $(CFG_DIR)$(UNICODE_DIR)<%noextension(project_name)%>
96 <%if(exename)%>
97 NAME         = <%exename%>$(EXEMODIFIER)
98 <%else%>
99 <%if(sharedname)%>
100 NAME         = <%libname_prefix%><%sharedname%>$(LIBMODIFIER)$(ULIBMODIFIER)
101 <%else%>
102 <%if(staticname)%>
103 NAME         = <%libname_prefix%><%staticname%>$(LIBMODIFIER)$(ULIBMODIFIER)
104 <%endif%>
105 <%endif%>
106 <%endif%>
107 CPPDIR       = <%cppdir%>
108 RESDIR       = <%rcdir%>
109 <%if(exename || sharedname || staticname)%>
111 OBJFILES = \
112 <%foreach(source_files)%>
113            "$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)"<%fornotlast(" \\")%>
114 <%endfor%>
115 <%endif%>
116 <%if(libpaths)%>
118 LFLAGS   = \
119 <%if(build64bit)%>
120            -L"$(BDS)\lib\win64\release" -L"$(BDS)\lib\win64\debug" \
121 <%else%>
122            -L"$(BDS)\lib\win32\release" -L"$(BDS)\lib\win32\debug" \
123 <%endif%>
124 <%if(linkflags)%>
125         <%linkflags%> \
126 <%endif%>
127 <%if(StackReserveSize)%>
128            /S:<%StackReserveSize%> \
129 <%endif%>
130 <%if(StackCommitSize)%>
131            /Sc:<%StackCommitSize%> \
132 <%endif%>
133 <%if(!optimize)%>
134            -v<%if(libpaths)%> \<%endif%>
135 <%endif%>
136 <%foreach(libpaths)%>
137            -L"<%libpath%>" -j"<%libpath%>"<%fornotlast(" \\")%>
138 <%endfor%>
139 <%endif%>
141 LIBFILES = \
142 <%foreach(reverse(libs))%>
143            <%libname_prefix%><%lib%>$(LIBMODIFIER)$(ULIBMODIFIER)$(LIB_EXT) \
144 <%endfor%>
145 <%foreach(reverse(lit_libs))%>
146            <%lit_lib%>$(LIB_EXT) \
147 <%endfor%>
148 <%foreach(reverse(pure_libs))%>
149            <%pure_lib%> \
150 <%endfor%>
151 <%if(build64bit)%>
152            <%common_libs%> <%common64_libs%>
153 <%else%>
154            $(CG_LIB) <%common_libs%> <%common32_libs%>
155 <%endif%>
157 <%if(resource_files)%>
159 !ifndef STATIC_CFG
160 RESOURCE = \
161 <%foreach(resource_files)%>
162            $(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res<%fornotlast(" \\")%>
163 <%endfor%>
164 <%if(includes)%>
166 RC_FLAGS = \
167 <%foreach(includes)%>
168         -i"<%include%>"<%fornotlast(" \\")%>
169 <%endfor%>
170 <%endif%>
171 !endif
172 <%endif%>
173 <%if(!build64bit)%>
174 <%if(pch_header)%>
176 # Borland precompiled headers can choke on some header files.
177 # Set NO_USE_PCH if you do not want to use precompiled headers.
178 !ifndef NO_USE_PCH
179 PCH_CFLAGS = \
180 <%foreach(pch_defines)%>
181              -D<%pch_define%> \
182 <%endfor%>
183              -H=$(INTERMEDIATE)\<%noextension(project_name)%>.csm -Hh=<%pch_header%>
184 !endif
185 <%endif%>
186 <%endif%>
188 CFLAGS = \
189 <%foreach(cflags)%>
190          <%cflag%> \
191 <%endfor%>
192 <%if(build64bit)%>
193 <%foreach(common64_flags)%>
194          <%common64_flag%> \
195 <%endfor%>
196 <%else%>
197 <%foreach(common32_flags)%>
198          <%common32_flag%> \
199 <%endfor%>
200 <%endif%>
201 <%foreach(macros common_defines)%>
202          -D<%macro%> \
203 <%endfor%>
204 <%foreach(includes)%>
205          -I"<%include%>" \
206 <%endfor%>
207          $(PCH_CFLAGS) \
208          $(VCL_CFLAGS)
210 <%marker(macros)%>
211 <%if(exename)%>
212 OUTPUTDIR = $(EXEOUTPUTDIR)
213 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(EXE_EXT)<%if(postbuild)%> __postbuild__<%endif%>
215 $(OUTPUTDIR)$(NAME)$(EXE_EXT): $(OBJFILES) $(RESOURCE)
216   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
217 <%if(prelink)%>
218   <%eval(prelink)%>
219 <%endif%>
220 <%if(build64bit)%>
221   $(LINK64) @&&!
222 <%else%>
223   $(LINK32) @&&!
224 <%endif%>
225   $(EXEFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE)
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 <%if(build64bit)%>
240   $(LINK64) @&&!
241 <%else%>
242   $(LINK32) @&&!
243 <%endif%>
244   $(DLLFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE)
246 !endif
248 <%endif%>
249 <%if(staticname)%>
250 !ifdef STATIC_CFG
251 OUTPUTDIR = <%libout%>\\
252 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(LIB_EXT)<%if(postbuild)%> __postbuild__<%endif%>
254 $(OUTPUTDIR)$(NAME)$(LIB_EXT): $(OBJFILES)
255   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
256   $(TLIB) $(LIBFLAGS) $(OUTPUTDIR)$(NAME)$(LIB_EXT) @&&!
257 + $(**: = &^
258 + )
260 !endif
262 <%endif%>
263 <%if(!exename && !sharedname && !staticname)%>
264 all:<%if(prebuild)%> __prebuild__<%endif%><%if(postbuild)%> __postbuild__<%endif%>
265   @-rem
267 <%endif%>
268 <%if(custom_types)%>
269 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%>
270 <%foreach(custom_types)%>
271 <%if(custom_type->libpath)%>
272 PATH = $(PATH);<%custom_type->libpath%>
273 <%endif%>
274 <%foreach(custom_type->input_files)%>
275 <%if(custom_type->input_file->output_files)%>
276 <%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%>
277 <%if(flag_overrides(custom_type->input_file, gendir))%>
278         @if not exist "<%flag_overrides(custom_type->input_file, gendir)%>" mkdir "<%flag_overrides(custom_type->input_file, gendir)%>"
279 <%endif%>
280   <%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%>
281 <%if(flag_overrides(custom_type->input_file, postcommand))%>
282 <%foreach(custom_type->input_file)%>
283   <%flag_overrides(custom_type->input_file, postcommand)%>
284 <%endfor%>
285 <%else%>
286 <%if(custom_type->postcommand)%>
287 <%foreach(custom_type->input_file)%>
288   <%custom_type->postcommand%>
289 <%endfor%>
290 <%endif%>
291 <%endif%>
292 <%if(pch_header)%>
293 <%if(custom_type->pch_postrule)%>
294 <%foreach(custom_type->input_file->source_output_files)%>
295   @echo \#include "<%pch_header%>" > temporary.src
296   @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
297   @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%>
298 <%endfor%>
299 <%endif%>
300 <%endif%>
302 <%endif%>
303 <%endfor%>
304 <%endfor%>
305 <%if(exename || sharedname || staticname)%>
306 <%if(source_files)%>
307 $(OBJFILES): $(GENERATED_DIRTY)
308 <%else%>
309 all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
310 <%endif%>
311 <%else%>
312 all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
313 <%endif%>
315 <%endif%>
316 generated: $(GENERATED_DIRTY)
317   @-rem
319 .path$(OBJ_EXT) = $(INTERMEDIATE)
321 .path.cpp = $(CPPDIR)
322 .cpp$(OBJ_EXT):
323   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
324 <%if(build64bit)%>
325         $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
326 <%else%>
327         $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
328 <%endif%>
330 .path.cxx = $(CPPDIR)
331 .cxx$(OBJ_EXT):
332   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
333 <%if(build64bit)%>
334         $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
335 <%else%>
336         $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
337 <%endif%>
339 .path.cc = $(CPPDIR)
340 .cc$(OBJ_EXT):
341   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
342 <%if(build64bit)%>
343         $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
344 <%else%>
345         $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
346 <%endif%>
348 .path.C = $(CPPDIR)
349 .C$(OBJ_EXT):
350   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
351 <%if(build64bit)%>
352         $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
353 <%else%>
354         $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
355 <%endif%>
357 .path.c = $(CPPDIR)
358 .c$(OBJ_EXT):
359   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
360 <%if(build64bit)%>
361         $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
362 <%else%>
363         $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
364 <%endif%>
366 <%foreach(source_files)%>
367 <%if(transdir(source_file) || flag_overrides(source_file, buildflags))%>
368 "$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)":
369   @if not exist "$(INTERMEDIATE)\<%transdir(source_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(source_file)%>"
370 <%if(build64bit)%>
371   $(CC64) <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) <%source_file%>
372 <%else%>
373   $(CC32) <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) <%source_file%>
374 <%endif%>
376 <%endif%>
377 <%endfor%>
378 <%if(resource_files)%>
379 !ifndef STATIC_CFG
380 .path.res = $(INTERMEDIATE)
382 .path.rc = $(RESDIR)
383 .rc.res:
384   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
385         $(RC32) $(RC_FLAGS) -fo$@ $<
387 <%foreach(resource_files)%>
388 <%if(transdir(resource_file))%>
389 "$(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res":
390   @if not exist "$(INTERMEDIATE)\<%transdir(resource_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(resource_file)%>"
391   $(RC32) -fo$@ <%resource_file%>
393 <%endif%>
394 <%endfor%>
395 !endif
397 <%endif%>
398 clean:
399         @if exist "$(INTERMEDIATE)" rmdir /s/q $(INTERMEDIATE)
401 realclean: clean
402 <%foreach(custom_types)%>
403 <%foreach(custom_type->input_files)%>
404 <%if(custom_type->input_file->output_files)%>
405 <%foreach(custom_type->input_file->output_files)%>
406 <%if(flag_overrides(custom_type->input_file, gendir))%>
407         @del "<%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%>" 2>NUL
408 <%else%>
409         @del "<%custom_type->input_file->output_file%>" 2>NUL
410 <%endif%>
411 <%endfor%>
412 <%endif%>
413 <%endfor%>
414 <%endfor%>
415 <%if(exename)%>
416         @del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" 2>NUL
417 <%else%>
418 <%if(sharedname)%>
419         @del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" 2>NUL
420 <%endif%>
421 <%if(staticname)%>
422         @del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" 2>NUL
423 <%endif%>
424 <%endif%>
425 <%if(exename || sharedname || staticname)%>
426         @del "$(OUTPUTDIR)$(NAME)$(POSTLINKRM)" 2>NUL
427 <%endif%>
428 <%if(postclean)%>
429   -<%eval(postclean)%>
430 <%endif%>
432 <%if(prebuild)%>
433 __prebuild__:
434   @<%eval(prebuild)%>
436 <%endif%>
437 <%if(postbuild)%>
438 __postbuild__:
439   @<%eval(postbuild)%>
441 <%endif%>
442 <%marker(local)%>
443 <%marker(bottom)%>