1 #----------------------------------------------------------------------------
3 #----------------------------------------------------------------------------
7 ICONOPT =<%foreach(ico_files)%><%if(forfirst)%> <%ico_flag%><%ico_file%><%endif%><%endfor%>
8 RESXOPT =<%foreach(resx_files)%> <%resx_flag%><%resx_file%><%endfor%>
9 TARGETDIR = <%if(exename && exeout)%><%exeout%><%slash%><%targetoutdir%><%else%><%if(sharedname && libout)%><%libout%><%slash%><%targetoutdir%><%else%>.<%slash%><%targetoutdir%><%endif%><%endif%>
10 TARGET =<%if(exename)%> $(TARGETDIR)<%exename%><%exe_ext%><%else%><%if(sharedname)%> $(TARGETDIR)<%lib_prefix%><%libname_prefix%><%sharedname%><%dll_ext%><%endif%><%endif%>
11 LDFLAGS =<%if(libpaths)%> <%lib_flag%><%foreach(libpaths)%><%libpath%><%fornotlast(",")%><%endfor%><%endif%><%if(libs || lit_libs || pure_libs)%> <%ref_flag%><%foreach(libs)%><%libname_prefix%><%lib%><%if(lit_libs || pure_libs)%>,<%else%><%fornotlast(",")%><%endif%><%endfor%><%foreach(lit_libs pure_libs)%><%lit_lib%><%fornotlast(",")%><%endfor%><%endif%><%if(packages)%> <%pkg_flag%><%foreach(packages)%><%package%><%fornotlast(",")%><%endfor%><%endif%>
12 CFLAGS =<%if(compile_flags)%> <%compile_flags%><%endif%> <%if(optimize)%><%opt_flag%><%else%><%def_flag%>DESIGN,DEBUG<%endif%><%if(trace)%> <%def_flag%>TRACE<%endif%><%if(macros)%> <%def_flag%><%foreach(macros)%><%macro%><%fornotlast(",")%><%endfor%><%endif%><%if(keyfile)%> <%key_flag%><%keyfile%><%endif%><%if(compares(allowunsafeblocks, true))%> <%unsafe_flag%><%endif%>
13 TESTDIRSTART = <%testdirstart("test -d")%>
14 TESTDIREND = <%testdirend("||")%>
16 MV = <%move("mv -f")%>
17 RM = <%delete("rm -rf")%>
18 CP = <%copy("cp -p")%>
19 NUL = <%devnull("/dev/null")%>
20 MKDIR = <%makedir("mkdir -p")%>
22 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)%><%slash%><%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%><%endif%><%endfor%><%endfor%>
26 MONO_CONFIG = $(MONO_ETC)/config
27 BIN = $(TARGETDIR)<%exename%>
29 <%if(supports_include && make_include)%>
31 include <%make_include%>
35 #----------------------------------------------------------------------------
37 #----------------------------------------------------------------------------
39 all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY) $(TARGET)<%if(postbuild)%> __postbuild__<%endif%>
42 $(TARGET): <%source_files%>
43 @$(TESTDIRSTART) "$(TARGETDIR)" $(TESTDIREND) $(MKDIR) "$(TARGETDIR)"
44 <%compiler%> <%if(winapp)%><%winexe_flag%><%else%><%exe_flag%><%endif%> <%out_flag%>$(TARGET) $(CFLAGS) $(LDFLAGS) $(ICONOPT) $(RESXOPT) <%source_files%>
47 <%mkbundle%> --static --deps -z --config $(MONO_CONFIG) $(TARGET) $(CONFIG_DIR_OPT) -o $(BIN)
54 $(TARGET): <%source_files%>
55 @$(TESTDIRSTART) "$(TARGETDIR)" $(TESTDIREND) $(MKDIR) "$(TARGETDIR)"
56 <%compiler%> <%shared_flag%> <%out_flag%>$(TARGET) $(CFLAGS) $(LDFLAGS) $(ICONOPT) $(RESXOPT) <%source_files%>
63 <%foreach(custom_types)%>
64 <%if(expanded_variable_assignment && custom_type->libpath)%>
65 DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):<%custom_type->libpath%>
66 LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):<%custom_type->libpath%>
67 SHLIB_PATH := $(SHLIB_PATH):<%custom_type->libpath%>
68 LIBPATH := $(LIBPATH):<%custom_type->libpath%>
69 PATH := $(PATH):<%custom_type->libpath%>
72 <%foreach(custom_type->input_files)%>
73 <%if(custom_type->input_file->output_files)%>
74 <%if(multiple(custom_type->input_file->output_files))%>
77 <%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%><%slash%><%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%><%if(flag_overrides(custom_type->input_file, dependent))%> <%flag_overrides(custom_type->input_file, dependent)%><%else%><%if(custom_type->dependent)%> <%custom_type->dependent%><%endif%><%endif%><%if(!need_staticflags)%><%if(flag_overrides(custom_type->input_file, dependent_libs))%><%foreach(dep_lib, flag_overrides(custom_type->input_file, dependent_libs))%><%dirname(dep_lib)%>/<%lib_prefix%><%libname_prefix%><%basename(dep_lib)%><%dll_ext%><%endfor%><%else%><%if(custom_type->dependent_libs)%><%foreach(custom_type->dependent_libs)%><%dirname(custom_type->dependent_lib)%>/<%lib_prefix%><%libname_prefix%><%basename(custom_type->dependent_lib)%><%dll_ext%><%endfor%><%endif%><%endif%><%endif%>
78 <%if(flag_overrides(custom_type->input_file, gendir))%>
79 @$(TESTDIRSTART) "<%flag_overrides(custom_type->input_file, gendir)%>" $(TESTDIREND) $(MKDIR) "<%flag_overrides(custom_type->input_file, gendir)%>"
81 <%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%>
82 <%if(flag_overrides(custom_type->input_file, postcommand))%>
83 <%foreach(custom_type->input_file)%>
84 <%flag_overrides(custom_type->input_file, postcommand)%>
87 <%if(custom_type->postcommand)%>
88 <%foreach(custom_type->input_file)%>
89 <%custom_type->postcommand%>
97 .PRECIOUS: $(GENERATED_DIRTY)
99 generated: $(GENERATED_DIRTY)
103 -$(RM) $(TARGET)<%if(exename)%> $(BIN)<%endif%><%if(clean)%> <%clean%><%endif%>
107 -$(RM) $(GENERATED_DIRTY)
124 #----------------------------------------------------------------------------
126 #----------------------------------------------------------------------------