# -*- Makefile -*- #---------------------------------------------------------------------------- # GNU Makefile # # @file <%project_file%> # # $Id$ # # This file was automatically generated by MPC. Any changes made directly to # this file will be lost the next time it is generated. # #---------------------------------------------------------------------------- <%marker(top)%> MAKEFILE = <%project_file%> DEPENDENCY_FILE = .depend.<%project_name%> <%if(exename)%> BIN_UNCHECKED = <%exename%> <%endif%> <%if(staticname)%> ## LIB may be set to empty later on in this file LIB_UNCHECKED = lib<%staticname%>.a LIB = $(LIB_UNCHECKED) <%if(!sharedname)%> static_libs_only = 1 <%endif%> <%endif%> <%if(sharedname)%> ## SHLIB may be set to empty later on in this file SHLIB_UNCHECKED = lib<%sharedname%>.$(SOEXT) SHLIB = $(SHLIB_UNCHECKED) <%endif%> <%if(tao)%> ifndef TAO_ROOT TAO_ROOT = $(ACE_ROOT)/TAO endif ifndef CIAO_ROOT CIAO_ROOT = $(TAO_ROOT)/CIAO endif <%endif%> <%if(grouped_source_files)%> <%foreach(grouped_source_files)%> <%grouped_source_file%> = \ <%foreach(grouped_source_file->files)%> <%noextension(grouped_source_file->file)%><%fornotlast(" \\")%> <%endfor%> <%endfor%> FILES += \ <%foreach(grouped_source_files)%> $(<%grouped_source_file%>)<%fornotlast(" \\")%> <%endfor%> <%else%> FILES = \ <%foreach(source_files)%> <%noextension(source_file)%><%fornotlast(" \\")%> <%endfor%> <%endif%> <%if(resource_files)%> RESOURCES += \ <%foreach(resource_files)%> <%resource_file%><%fornotlast(" \\")%> <%endfor%> <%endif%> <%vpath%> #---------------------------------------------------------------------------- # Include macros and targets #---------------------------------------------------------------------------- <%marker(macros)%> <%if(exename)%> LDLIBS =<%foreach(libs)%> -l<%lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%> <%else%> <%if(sharedname)%> ACE_SHLIBS =<%foreach(libs)%> -l<%lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%> <%endif%> <%endif%> <%if(tao_idl)%> TAO_IDL = <%tao_idl%> <%endif%> <%if(tao_idlflags)%> TAO_IDLFLAGS = <%tao_idlflags%> <%endif%> include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU ## We don't need the ACELIB setting from wrapper_macros.GNU ACELIB = <%if(tao)%> tao_dont_use_idl_make_rule = 1 include $(TAO_ROOT)/rules.tao.GNU <%endif%> # To build multiple targets in the same directory on AIX, it works # best to have a template directory per project. # The compiler/linker isn't too smart about instantiating templates... ifdef TEMPINCDIR TEMPINCDIR := $(TEMPINCDIR)/<%project_name%> all: $(TEMPINCDIR) endif <%if(exename)%> INSBIN ?= <%if(install)%><%install%><%else%>.<%endif%> OUTPUT_DIRECTORY = $(INSBIN) <%else%> INSLIB ?= <%if(dllout)%><%dllout%><%else%><%libout%><%endif%> ifeq ($(INSLIB),.) ifeq ($(PWD),) PWD=$(shell pwd) endif INSLIB = $(PWD) endif OUTPUT_DIRECTORY = $(INSLIB) <%endif%> all: $(OUTPUT_DIRECTORY) $(OUTPUT_DIRECTORY): -@mkdir -p "$(OUTPUT_DIRECTORY)" <%if(sharedname || staticname || exename)%> <%if(libs && libpaths)%> # turn off libcheck if doing a dry run ifeq ($(findstring n, $(MAKEFLAGS)),n) LIBCHECK = 1 else # turn off libcheck if keep going was passed too ifeq ($(findstring k, $(MAKEFLAGS)),k) LIBCHECK = 1 else LIBCHECK ?= $(filter-out $(foreach lib,<%libs%>,$(findstring $(lib),$(foreach libpath,<%libpaths%> /usr/lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),<%libs%>) ifeq ($(LIBCHECK),) LIBCHECK = 1 endif endif endif <%else%> LIBCHECK = 1 <%endif%> <%else%> LIBCHECK = 1 <%endif%> <%if(!exename)%> <%foreach(requires)%> ifeq ($(<%require%>),1) <%endfor%> <%foreach(avoids)%> ifneq ($(<%avoid%>),1) <%endfor%> ifneq ($(LIBCHECK), 1) <%if(staticname)%> LIB = <%endif%> <%if(sharedname)%> SHLIB = <%endif%> all: lib_warning endif <%foreach(avoids)%> else <%if(staticname)%> LIB = <%endif%> <%if(sharedname)%> SHLIB = <%endif%> all: avoid_warning endif <%endfor%> <%foreach(requires)%> else <%if(staticname)%> LIB = <%endif%> <%if(sharedname)%> SHLIB = <%endif%> all: require_warning endif <%endfor%> <%if(tagname)%> ifeq (,$(<%tagname%>)) <%endif%> <%foreach(requires)%> ifeq ($(<%require%>),1) <%endfor%> <%foreach(avoids)%> ifneq ($(<%avoid%>),1) <%endfor%> <%foreach(avoids)%> else <%if(staticname)%> LIB = <%endif%> <%if(sharedname)%> SHLIB = <%endif%> all: avoid_warning endif <%endfor%> <%foreach(requires)%> else <%if(staticname)%> LIB = <%endif%> <%if(sharedname)%> SHLIB = <%endif%> all: require_warning endif <%endfor%> <%if(tagname)%> else <%foreach(requires)%> ifeq ($(<%require%>),1) <%endfor%> <%foreach(avoids)%> ifneq ($(<%avoid%>),1) <%endfor%> <%foreach(tagchecks)%> ifeq (<%tagcheck%>, $(findstring <%tagcheck%>, $(<%tagname%>))) <%endfor%> <%foreach(tagchecks)%> else LIB = SHLIB = endif <%endfor%> <%foreach(avoids)%> else LIB = SHLIB = all: avoid_warning endif <%endfor%> <%foreach(requires)%> else LIB = SHLIB = all: require_warning endif <%endfor%> endif <%endif%> <%endif%> <%if(exename)%> <%foreach(requires)%> ifeq ($(<%require%>),1) <%endfor%> <%foreach(avoids)%> ifneq ($(<%avoid%>),1) <%endfor%> ifeq ($(LIBCHECK), 1) BIN = $(BIN_UNCHECKED)$(EXEEXT) else all: lib_warning endif <%foreach(avoids)%> else all: avoid_warning endif <%endfor%> <%foreach(requires)%> else all: require_warning endif <%endfor%> OBJS = $(addsuffix .o, $(notdir $(FILES))) SRC = $(addsuffix .cpp, $(FILES)) <%endif%> ifneq (,$(RC)) FILES += $(RESOURCES) endif <%if(sharedname || staticname)%> LSRC = $(addsuffix .cpp, $(FILES)) <%endif%> <%marker(circuit)%> include $(ACE_ROOT)/include/makeinclude/macros.GNU include $(ACE_ROOT)/include/makeinclude/rules.common.GNU include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU <%if(install && exename)%> ifneq ($(OUTPUT_DIRECTORY),.) INSTALL = $(VBIN:%=$(INSBIN)/%) CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/%) endif <%endif%> <%if(sharedname || staticname)%> include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU <%endif%> <%if(pch_source)%> ACE_PCH_SOURCE = <%pch_source%> ACE_PCH_FILE = <%basename(pch_header)%>.gch ifeq ($(pchsupport),1) <%if(pch_defines)%> CPPFLAGS +=<%foreach(pch_defines)%> -D<%pch_define%><%endfor%> <%endif%> $(addprefix $(VDIR), $(OBJS)): $(VDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(VSHDIR)$(ACE_PCH_FILE) endif <%endif%> include $(ACE_ROOT)/include/makeinclude/rules.local.GNU <%if(tao)%> include $(TAO_ROOT)/taoconfig.mk <%endif%> <%if(libpaths)%> LDFLAGS +=<%foreach(libpaths)%> -L<%libpath%><%endfor%> <%endif%> <%if(includes)%> CPPFLAGS +=<%foreach(includes)%> -I<%include%><%endfor%> <%endif%> <%if(macros)%> CPPFLAGS +=<%foreach(macros)%> -D<%macro%><%endfor%> <%endif%> <%if(dynamicflags)%> ifeq ($(shared_libs),1) ifneq ($(SHLIB),) CPPFLAGS +=<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%> endif endif <%endif%> <%if(staticflags)%> ifeq ($(static_libs),1) CPPFLAGS +=<%foreach(staticflags)%> -D<%staticflag%><%endfor%> endif <%endif%> #---------------------------------------------------------------------------- # Local targets #---------------------------------------------------------------------------- <%marker(local)%> lib_warning: @echo This project will not be built due to the following missing library: @echo $(LIBCHECK) <%if(requires)%> require_warning: @echo This project will not be built due to one of the following missing features: @echo<%foreach(requires)%> <%require%><%endfor%> <%endif%> <%if(avoids)%> avoid_warning: @echo This project will not be built due to one of the following enabled features: @echo<%foreach(avoids)%> <%avoid%><%endfor%> <%endif%> <%if(custom_types)%> <%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)%> GENERATED_DIRTY +=<%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%> <%if(custom_type->input_file->non_source_output_files)%> OBJS_DEPEND_ON_GENERATED = 1 <%endif%> <%foreach(custom_type->input_file->output_files)%> <%if(forlast && !forfirst)%> ## More than one file is generated by the command and therefore ## it can not be run in parallel. Unfortunately, there is no way to ## say that only this rule can't be run in parallel. However, we can ## determine if the generated files have already been generated. If that's ## the case, then we don't need this special rule. ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY)) ## If we can find /bin/test, then we will continue ifeq ($(wildcard /bin/test), /bin/test) ## If all of the generated files are there, then we need to check ## and make sure that the generated files are up-to-date. If they are not ## then we need the special rule. ifneq ($(shell<%foreach(custom_type->input_file->output_files)%> /bin/test <%custom_type->input_file%> -nt <%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%> 2> /dev/null &&<%endfor%> echo 0),) .NOTPARALLEL: <%if(custom_type->dependent)%> else ## By this point, all of the generated files are here and up-to-date ## with respect to the source file. Now we need to make sure that ## they are up-to-date with respect to the generation tool. If the tool ## is newer than the generated files, then we need the special rule. ifneq ($(shell<%foreach(custom_type->input_file->output_files)%> /bin/test <%custom_type->command%>$(EXEEXT) -nt <%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%> 2> /dev/null &&<%endfor%> echo 0),) .NOTPARALLEL: endif <%endif%> endif else .NOTPARALLEL: endif else .NOTPARALLEL: endif <%endif%> <%endfor%> <%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->dependent)%> <%custom_type->command%>$(EXEEXT)<%endif%> <%custom_type->command%> <%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%> <%if(custom_type->postcommand)%> <%foreach(custom_type->input_file->output_files)%> <%custom_type->postcommand()%> <%endfor%> <%endif%> <%if(pch_header)%> <%if(custom_type->pch_postrule)%> <%foreach(custom_type->input_file->source_output_files)%> @echo '#include "<%pch_header%>"' > temp.$$$$ && cat <%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%> >> temp.$$$$ && mv temp.$$$$ <%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%> <%endfor%> <%endif%> <%endif%> <%endif%> <%endfor%> <%endfor%> ifneq ($(GENERATED_DIRTY),) .PRECIOUS: $(GENERATED_DIRTY) <%if(source_files)%> ## If the generated files are anything but source files, we need to ## ensure that those files are generated before we attempt to build anything ## else. ifeq ($(OBJS_DEPEND_ON_GENERATED),1) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY) $(VSHOBJS): $(GENERATED_DIRTY) endif <%else%> <%foreach(requires)%> ifeq ($(<%require%>),1) <%endfor%> <%foreach(avoids)%> ifneq ($(<%avoid%>),1) <%endfor%> all: $(GENERATED_DIRTY) <%foreach(avoids)%> endif <%endfor%> <%foreach(requires)%> endif <%endfor%> <%endif%> endif <%endif%> <%if(idl_files)%> <%if(source_files)%> ADDITIONAL_IDL_TARGETS +=<%foreach(idl_files)%> <%if(flag_overrides(idl_file, gendir))%><%flag_overrides(idl_file, gendir)%>/<%basenoextension(idl_file)%>$(IDL_CLIENT_HDR_EXT)<%else%><%noextension(idl_file)%>$(IDL_CLIENT_HDR_EXT)<%endif%><%endfor%> idl_stubs: $(ADDITIONAL_IDL_TARGETS) # This assignment forces make to run the idl_stubs # target before building any of the source files. FORCED_IDL_STUBS = <%source_files%> <%foreach(custom_types)%> <%foreach(custom_type->input_files)%> <%if(custom_type->input_file->source_output_files)%> <%foreach(custom_type->input_file->source_output_files)%> FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:<%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%>=) <%endfor%> <%endif%> <%endfor%> <%endfor%> ifneq ($(FORCED_IDL_STUBS),) $(FORCED_IDL_STUBS): idl_stubs endif <%endif%> <%endif%> <%if(exename)%> ifndef kylix $(BIN): $(addprefix $(VDIR), $(OBJS)) $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK) else $(BIN): $(addprefix $(VDIR), $(OBJS)) $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $(VLDLIBS) $(BORINITEXEOBJ) $(POSTLINK) $^, $@,, endif <%endif%> realclean: clean ifneq ($(GENERATED_DIRTY),) -$(RM) -r $(GENERATED_DIRTY) endif <%marker(bottom)%>