#---------------------------------------------------------------------------- # Macros #---------------------------------------------------------------------------- <%marker(top)%> <%foreach(configurations)%> CXX = <%cxx%> <%endfor%> CCC = $(CXX) MAKEFILE = <%project_file%> DEPENDENCIES = .depend.$(MAKEFILE) <%if(exename)%> BIN = <%exename%> <%endif%> <%if(staticname)%> LIB = lib<%staticname%>.a <%endif%> <%foreach(platforms)%> <%if(soext)%> <%if(sharedname)%> SHLIB = lib<%sharedname%>.$(SOEXT) SOEXT = <%soext%> <%foreach(configurations)%> <%if(pic)%> PICFLAGS = <%pic%> <%endif%> <%endfor%> <%foreach(platforms)%> <%if(shflags)%> SHFLAGS = <%shflags%> <%endif%> <%endfor%> <%endif%> <%endif%> <%endfor%> <%foreach(configurations)%> <%if(tempinc)%> TEMPINCDIR = <%tempinc%>/<%project_name%> <%endif%> <%endfor%> GENFLAGS = <%genflags(-g)%> CPPFLAGS = $(PICFLAGS) $(GENFLAGS)<%if(cppflags)%> <%cppflags%><%endif%><%foreach(configurations)%><%if(tempinc)%> <%tempincopt%>$(TEMPINCDIR)<%endif%><%endfor%><%foreach(platforms)%><%if(extracppflags)%> <%extracppflags%><%endif%><%endfor%><%foreach(configurations)%><%if(compilerflags)%> <%compilerflags%><%endif%><%endfor%><%if(pch_header)%><%foreach(pch_defines)%> -D<%pch_define%><%endfor%><%endif%><%if(includes)%><%foreach(includes)%> -I<%include%><%endfor%><%endif%><%if(macros)%><%foreach(macros)%> -D<%macro%><%endfor%><%endif%> <%if(arflags)%> ARFLAGS = <%arflags%> <%endif%> <%if(idl_files)%> IDL_FILES =<%foreach(idl_files)%> <%noextension(idl_file)%><%endfor%> IDL_SRC =<%foreach(idl_files)%> <%noextension(idl_file)%>C.cpp <%noextension(idl_file)%>S.cpp<%endfor%> <%endif%> SRC =<%foreach(source_files)%> <%source_file%><%endfor%> OBJS =<%foreach(source_files)%> <%noextension(source_file)%>.o<%endfor%> LDFLAGS =<%if(libpaths)%><%foreach(libpaths)%> -L<%libpath%><%endfor%><%endif%><%foreach(configurations)%><%if(linkflags)%> <%linkflags%><%endif%><%endfor%> LDLIBS =<%foreach(platforms)%> <%ldlibs%><%endfor%><%if(libs)%><%foreach(libs)%> -l<%lib%><%endfor%><%endif%><%if(defaultlibs)%><%foreach(defaultlibs)%> -l<%defaultlib%><%endfor%><%endif%><%if(lit_libs)%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%endif%> LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) COMPILE.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) -c RM = rm -f OUTPUT_OPTION = -o $@ <%marker(macros)%> #---------------------------------------------------------------------------- # Local targets #---------------------------------------------------------------------------- <%marker(local)%> <%if(custom_types)%> 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%> <%foreach(custom_types)%> <%if(custom_types->libpath)%> DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):<%custom_type->libpath%> LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):<%custom_type->libpath%> SHLIB_PATH := $(SHLIB_PATH):<%custom_type->libpath%> LIBPATH := $(LIBPATH):<%custom_type->libpath%> PATH := $(PATH):<%custom_type->libpath%> <%endif%> <%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%>: <%custom_type->input_file%> <%custom_type->command%> <%if(pch_header)%><%if(custom_type->pch_option)%><%custom_type->pch_option%><%pch_header%> <%endif%><%endif%><%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%custom_type->input_file%> <%if(custom_type->output_option)%><%custom_type->output_option%> $@<%endif%> <%endfor%> <%endif%> <%endfor%> <%endfor%> .PRECIOUS: $(GENERATED_DIRTY) all: $(GENERATED_DIRTY) <%endif%> <%foreach(configurations)%> <%if(tempinc)%> all: $(TEMPINCDIR) $(TEMPINCDIR): @-test -d $(TEMPINCDIR) || mkdir -p $(TEMPINCDIR) 2> /dev/null || true <%endif%> <%endfor%> <%if(exename)%> all: $(BIN) <%if(install)%>install<%endif%> $(BIN): $(OBJS) $(LINK.cc) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%endif%> <%foreach(platforms)%> <%if(soext)%> <%if(sharedname)%> INSTARGET = $(SHLIB) all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%> $(SHLIB): $(OBJS) <%foreach(configurations)%><%foreach(platforms)%><%if(dld)%><%dld%> $(LDFLAGS)<%else%>$(LINK.cc)<%endif%><%endfor%><%endfor%> $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS) <%endif%> <%else%> <%if(staticname)%> INSTARGET = $(LIB) all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%> <%endif%> <%endif%> <%endfor%> <%if(staticname)%> $(LIB): $(OBJS) $(AR) $(ARFLAGS) $(LIB) $(OBJS)<%foreach(configurations)%><%if(tempinc)%> `find $(TEMPINCDIR) -type f`<%endif%><%endfor%> <%endif%> <%foreach(source_files)%> <%noextension(source_file)%>.o: <%source_file%> $(COMPILE.cc) <%source_file%> $(OUTPUT_OPTION) <%endfor%> <%if(install)%> <%if(exename)%> INSTARGET = $(BIN) install: @if [ "<%install%>" != "." ]; then \ echo "Installing $(INSTARGET) -> <%install%>/$(INSTARGET)"; \ -test -d "<%install%>" || mkdir -p "<%install%>" 2> /dev/null || true; \ $(RM) "<%install%>/$(INSTARGET)"; \ ln -s "$(PWD)/$(INSTARGET)" "<%install%>"; \ fi <%endif%> <%else%> <%if(!exename)%> install: @if [ "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" != "." ]; then \ test -d "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" || mkdir -p "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" 2> /dev/null || true; \ $(RM) "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>/$(INSTARGET)"; \ ln -s "$(PWD)/$(INSTARGET)" "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>"; \ fi <%endif%> <%endif%> clean: -$(RM) $(OBJS) <%foreach(configurations)%> <%if(clean)%> -$(RM) -r <%clean%> <%endif%> <%endfor%> realclean: clean -$(RM) <%if(exename)%>$(BIN)<%else%>$(SHLIB) $(LIB)<%endif%><%if(install)%> <%install%>/$(INSTARGET)<%endif%> <%if(custom_types)%> -$(RM) -r $(GENERATED_DIRTY) <%endif%> #---------------------------------------------------------------------------- # Dependencies #---------------------------------------------------------------------------- $(DEPENDENCIES): @touch $(DEPENDENCIES) depend: <%depgen("makedepend -Y")%> $(CFLAGS) $(CCFLAGS) $(CPPFLAGS) -f $(DEPENDENCIES) $(SRC) 2> /dev/null include $(DEPENDENCIES) <%marker(bottom)%>