Changes to handle the fact that clang response files expect unix paths
[MPC.git] / templates / bmake.mpd
blob7c268254a6b99d6deb412a10336a9ae757687f6a
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 LINKER_PASSTHROUGH = <%linker_passthrough%>
28 STARTUP_BITS = <%startup_bits%>
29 LINK = <%link%>
30 COMMON_LIBS = <%common_libs%>
31 TLIB = <%tlib%>
32 DLLFLAGS = <%dllflags%>
33 <%if(pch)%>PCH = 1<%endif%>
34 <%if(objectsearchpath)%>
35 OBJECTSEARCHPATH = \
36 <%foreach(libpaths)%>
37    -j"<%libpath%>"<%fornotlast(" \\")%>
38 <%endfor%>
39 <%endif%>
40 EXEFLAGS = <%exeflags%>
41 LINKER_DLL_ARGUMENTS = <%linker_dll_arguments%>
42 LINKER_EXE_ARGUMENTS = <%linker_exe_arguments%>
43 !else
44 <%endfor%>
45 !error You must select one of these compilers:<%foreach(compilers)%> <%normalize(uc(compiler))%><%endfor%>
46 <%foreach(compilers)%>
47 !endif
48 <%endfor%>
50 <%foreach(configurations)%>
51 !ifdef <%normalize(uc(configuration))%>
52 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%>
53 LFLAGS =<%if(debug_prj)%> $(PDB_FLAGS)<%endif%>
54 CFG_DIR = <%intermediate_dir%>\\
55 LIBMODIFIER = <%if(use_lib_modifier)%><%lib_modifier%><%endif%>
56 EXEMODIFIER = <%if(use_exe_modifier)%><%lib_modifier%><%endif%>
57 <%if(type_is_static)%>
58 STATIC_CFG = 1
59 <%endif%>
60 <%if(type_is_static || need_staticflags)%>
61 <%if(staticflags)%>
62 STATIC_FLAGS =<%foreach(staticflags)%> -D<%staticflag%><%endfor%>
63 <%endif%>
64 <%else%>
65 <%if(dynamicflags)%>
66 DYN_FLAGS =<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%>
67 <%endif%>
68 <%endif%>
69 <%if(postlinkrmext)%>
70 POSTLINKRM = <%postlinkrmext%>
71 <%endif%>
72 <%if(exename)%>
73 EXEOUTPUTDIR = <%if(exeout)%><%exeout%><%if(windows_style)%>\<%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%>\\
74 <%endif%>
75 !else
76 <%endfor%>
77 !error You must define one of these valid configurations:<%foreach(configurations)%> <%normalize(uc(configuration))%><%endfor%>
78 <%foreach(configurations)%>
79 !endif
80 <%endfor%>
82 !ifdef UNICODE
83 UC_CFLAGS    = <%unicode_flags%>
84 UNICODE_DIR  = Unicode\\
85 UC_MAIN      = w
86 ULIBMODIFIER = <%unicode_lib_modifier%>
87 UEXEMODIFIER = <%unicode_lib_modifier%>
88 !endif
90 !ifdef CODEGUARD
91 CG_CFLAGS = -vG
92 CG_LIB    = cg32.lib
93 !endif
95 DLL_EXT      = <%dll_ext%>
96 EXE_EXT      = <%exe_ext%>
97 RC           = <%rc%>
98 LIBFLAGS     = <%libflags%>
99 CCFLAGS      = $(CC_CFLAGS)<%if(type_is_binary)%> $(BINARY_FLAGS)<%endif%><%if(compile_flags)%> <%compile_flags%><%endif%>
101 <%if(use_vcl)%>
102 STARTUP_LETTER = <%if(exename)%>w<%else%><%startup_letter%><%endif%>
103 <%else%>
104 VCL_CFLAGS     = -D_NO_VCL
105 STARTUP_LETTER = <%startup_letter%>
106 <%endif%>
107 STARTUP_OBJ    = c0$(STARTUP_LETTER)$(STARTUP_BITS)$(UC_MAIN)$(OBJ_EXT)
109 INTERMEDIATE = $(CFG_DIR)$(UNICODE_DIR)<%noextension(project_name)%>
110 <%if(exename)%>
111 NAME         = <%exename%>$(EXEMODIFIER)
112 <%else%>
113 <%if(sharedname)%>
114 NAME         = <%libname_prefix%><%sharedname%>$(LIBMODIFIER)$(ULIBMODIFIER)
115 <%else%>
116 <%if(staticname)%>
117 NAME         = <%libname_prefix%><%staticname%>$(LIBMODIFIER)$(ULIBMODIFIER)
118 <%endif%>
119 <%endif%>
120 <%endif%>
121 CPPDIR       = <%cppdir%>
122 RESDIR       = <%rcdir%>
123 <%if(exename || sharedname || staticname)%>
125 OBJFILES = \
126 <%foreach(source_files)%>
127            "$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)"<%fornotlast(" \\")%>
128 <%endfor%>
129 <%endif%>
130 <%if(libpaths)%>
132 LFLAGS   = \
133            $(LFLAGS) \
134            $(LINKER_PATHS) \
135 <%if(debug_prj)%>
136            -v \
137            -r \
138 <%endif%>
139 <%if(linkflags)%>
140         <%linkflags%> \
141 <%endif%>
142 <%if(StackReserveSize)%>
143            $(STACK_LFLAG)<%StackReserveSize%> \
144 <%endif%>
145 <%if(StackCommitSize)%>
146            /Sc:<%StackCommitSize%> \
147 <%endif%>
148 <%if(!optimize)%>
149            -v<%if(libpaths)%> \<%endif%>
150 <%endif%>
151 <%foreach(libpaths)%>
152            -L"<%libpath%>" \
153 <%endfor%>
154            $(OBJECTSEARCHPATH)
155 <%endif%>
157 LIBFILES = \
158 <%foreach(reverse(libs))%>
159            $(LINKER_PASSTHROUGH) <%libname_prefix%><%lib%>$(LIBMODIFIER)$(ULIBMODIFIER)$(LIB_EXT) \
160 <%endfor%>
161 <%foreach(reverse(lit_libs))%>
162            $(LINKER_PASSTHROUGH) <%lit_lib%>$(LIB_EXT) \
163 <%endfor%>
164 <%foreach(reverse(platform_libs))%>
165            $(PLATFORM_LIBS_PREFIX)<%platform_libs%> \
166 <%endfor%>
167 <%foreach(reverse(pure_libs))%>
168            <%pure_lib%> \
169 <%endfor%>
170            $(COMMON_LIBS)
172 <%if(resource_files)%>
174 !ifndef STATIC_CFG
175 RESOURCE = \
176 <%foreach(resource_files)%>
177            $(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res<%fornotlast(" \\")%>
178 <%endfor%>
179 <%if(includes)%>
181 RC_FLAGS = \
182 <%foreach(includes)%>
183         -i"<%include%>"<%fornotlast(" \\")%>
184 <%endfor%>
185 <%endif%>
186 !endif
187 <%endif%>
189 <%if(pch_header)%>
190 # Set NO_USE_PCH if you do not want to use precompiled headers.
191 !ifndef NO_USE_PCH
192 !ifdef PCH
193 PCH_CFLAGS = <%foreach(pch_defines)%>-D<%pch_define%> <%endfor%>-H=$(INTERMEDIATE)\<%noextension(project_name)%>.csm -Hh=<%pch_header%>
194 !endif
195 !endif
196 <%endif%>
198 CFLAGS = \
199 <%foreach(cflags)%>
200          <%cflag%> \
201 <%endfor%>
202          $(COMMON_FLAGS) \
203          $(COMMON_DEFINES) \
204 <%foreach(macros common_defines)%>
205          -D<%macro%> \
206 <%endfor%>
207 <%foreach(includes)%>
208          -I"<%include%>" \
209 <%endfor%>
210          $(PCH_CFLAGS) \
211          $(VCL_CFLAGS)
213 <%marker(macros)%>
214 <%if(exename)%>
215 OUTPUTDIR = $(EXEOUTPUTDIR)
216 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(EXE_EXT)<%if(postbuild)%> __postbuild__<%endif%>
218 $(OUTPUTDIR)$(NAME)$(EXE_EXT): $(OBJFILES) $(RESOURCE)
219   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
220 <%if(prelink)%>
221   <%eval(prelink)%>
222 <%endif%>
223   $(LINK) @&&!
224   $(LINKER_EXE_ARGUMENTS)
227 <%endif%>
228 <%if(sharedname)%>
229 !ifndef STATIC_CFG
230 OUTPUTDIR = <%if(dllout)%><%dllout%><%else%><%libout%><%endif%>\\
231 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(DLL_EXT)<%if(postbuild)%> __postbuild__<%endif%>
233 $(OUTPUTDIR)$(NAME)$(DLL_EXT): $(OBJFILES) $(RESOURCE)
234   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
235 <%if(prelink)%>
236   <%eval(prelink)%>
237 <%endif%>
238   $(LINK) @&&!
239   $(LINKER_DLL_ARGUMENTS)
241 !endif
243 <%endif%>
244 <%if(staticname)%>
245 !ifdef STATIC_CFG
246 OUTPUTDIR = <%libout%>\\
247 all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(LIB_EXT)<%if(postbuild)%> __postbuild__<%endif%>
249 $(OUTPUTDIR)$(NAME)$(LIB_EXT): $(OBJFILES)
250   @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
251   $(TLIB) $(LIBFLAGS) $(OUTPUTDIR)$(NAME)$(LIB_EXT) @&&!
252 + $(**: = &^
253 + )
255 !endif
257 <%endif%>
258 <%if(!exename && !sharedname && !staticname)%>
259 all:<%if(prebuild)%> __prebuild__<%endif%><%if(postbuild)%> __postbuild__<%endif%>
260   @-rem
262 <%endif%>
263 <%if(custom_types)%>
264 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%>
265 <%foreach(custom_types)%>
266 <%if(custom_type->libpath)%>
267 PATH = $(PATH);<%custom_type->libpath%>
268 <%endif%>
269 <%foreach(custom_type->input_files)%>
270 <%if(custom_type->input_file->output_files)%>
271 <%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%>
272 <%if(flag_overrides(custom_type->input_file, gendir))%>
273         @if not exist "<%flag_overrides(custom_type->input_file, gendir)%>" mkdir "<%flag_overrides(custom_type->input_file, gendir)%>"
274 <%endif%>
275   <%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%>
276 <%if(flag_overrides(custom_type->input_file, postcommand))%>
277 <%foreach(custom_type->input_file)%>
278   <%flag_overrides(custom_type->input_file, postcommand)%>
279 <%endfor%>
280 <%else%>
281 <%if(custom_type->postcommand)%>
282 <%foreach(custom_type->input_file)%>
283   <%custom_type->postcommand%>
284 <%endfor%>
285 <%endif%>
286 <%endif%>
287 <%if(pch_header)%>
288 <%if(custom_type->pch_postrule)%>
289 <%foreach(custom_type->input_file->source_output_files)%>
290   @echo \#include "<%pch_header%>" > temporary.src
291   @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
292   @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%>
293 <%endfor%>
294 <%endif%>
295 <%endif%>
297 <%endif%>
298 <%endfor%>
299 <%endfor%>
300 <%if(exename || sharedname || staticname)%>
301 <%if(source_files)%>
302 $(OBJFILES): $(GENERATED_DIRTY)
303 <%else%>
304 all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
305 <%endif%>
306 <%else%>
307 all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
308 <%endif%>
310 <%endif%>
311 generated: $(GENERATED_DIRTY)
312   @-rem
314 .path$(OBJ_EXT) = $(INTERMEDIATE)
316 .path.cpp = $(CPPDIR)
317 .cpp$(OBJ_EXT):
318   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
319         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
321 .path.cxx = $(CPPDIR)
322 .cxx$(OBJ_EXT):
323   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
324         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
326 .path.cc = $(CPPDIR)
327 .cc$(OBJ_EXT):
328   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
329         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
331 .path.C = $(CPPDIR)
332 .C$(OBJ_EXT):
333   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
334         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
336 .path.c = $(CPPDIR)
337 .c$(OBJ_EXT):
338   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
339         $(CC) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS) $(CG_CFLAGS) $(UC_CFLAGS) $(THREAD_FLAGS) $(CCFLAGS) $(CFLAGS) $(WARN_FLAGS) -c -o $(@D)\$(@F) $<
341 <%foreach(source_files)%>
342 <%if(transdir(source_file) || flag_overrides(source_file, buildflags))%>
343 "$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)":
344   @if not exist "$(INTERMEDIATE)\<%transdir(source_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(source_file)%>"
345   $(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%>
346 <%endif%>
347 <%endfor%>
348 <%if(resource_files)%>
349 !ifndef STATIC_CFG
350 .path.res = $(INTERMEDIATE)
351 .path.rc = $(RESDIR)
352 .rc.res:
353   @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
354         $(RC) $(RC_FLAGS) -fo$@ $<
355 <%foreach(resource_files)%>
356 <%if(transdir(resource_file))%>
357 "$(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res":
358   @if not exist "$(INTERMEDIATE)\<%transdir(resource_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(resource_file)%>"
359   $(RC) -fo$@ <%resource_file%>
360 <%endif%>
361 <%endfor%>
362 !endif
364 <%endif%>
365 clean:
366         @if exist "$(INTERMEDIATE)" rmdir /s/q $(INTERMEDIATE)
368 realclean: clean
369 <%foreach(custom_types)%>
370 <%foreach(custom_type->input_files)%>
371 <%if(custom_type->input_file->output_files)%>
372 <%foreach(custom_type->input_file->output_files)%>
373 <%if(flag_overrides(custom_type->input_file, gendir))%>
374         @del "<%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%>" 2>NUL
375 <%else%>
376         @del "<%custom_type->input_file->output_file%>" 2>NUL
377 <%endif%>
378 <%endfor%>
379 <%endif%>
380 <%endfor%>
381 <%endfor%>
382 <%if(exename)%>
383         @del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" 2>NUL
384 <%else%>
385 <%if(sharedname)%>
386         @del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" 2>NUL
387 <%endif%>
388 <%if(staticname)%>
389         @del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" 2>NUL
390 <%endif%>
391 <%endif%>
392 <%if(exename || sharedname || staticname)%>
393         @del "$(OUTPUTDIR)$(NAME)$(POSTLINKRM)" 2>NUL
394 <%endif%>
395 <%if(postclean)%>
396   -<%eval(postclean)%>
397 <%endif%>
399 <%if(prebuild)%>
400 __prebuild__:
401   @<%eval(prebuild)%>
403 <%endif%>
404 <%if(postbuild)%>
405 __postbuild__:
406   @<%eval(postbuild)%>
408 <%endif%>
409 <%marker(local)%>
410 <%marker(bottom)%>