<%foreach(platform)%><%comment(there can't be more than one active platform but using a foreach allows platform settings to be grouped in scopes in the mpt files)%># The file ".wrmakefile" is the template used by the Wind River Workbench to
# generate the makefiles of this project. Add user-specific build targets and
# make rules only(!) in this project's ".wrmakefile" file. These will then be
# automatically dumped into the makefiles.

WIND_HOME := $(subst \,/,$(WIND_HOME))
<%foreach(platform_makefilevars)%>
<%platform_makefilevar%> := $(subst \,/,$(<%platform_makefilevar%>))
<%endfor%>
ACE_ROOT := $(subst \,/,$(ACE_ROOT))
TAO_ROOT := $(subst \,/,$(TAO_ROOT))
CIAO_ROOT := $(subst \,/,$(CIAO_ROOT))
HOST_ROOT := $(subst \,/,$(HOST_ROOT))
<%if(sharedname || staticname)%>
<%if(libout || dllout)%>
ACE_LIBOUT := <%if(dllout)%><%dllout%><%else%><%libout%><%endif%>
<%endif%>
<%endif%>
<%if(exename)%>
ACE_EXEOUT := <%exeout(".")%>
<%endif%>

ACE_EXE_EXT = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%exe_ext%>)<%endfor%>
<%if(exename)%>
ACE_TARGET_PREFIX :=
ACE_TARGET_NAME := <%exename%>
ACE_TARGET_EXT = $(ACE_EXE_EXT)
PROJECT_TARGET = $(if $(ACE_TARGET_EXT),$(filter %$(ACE_TARGET_EXT),$(PROJECT_TARGETS)),$(PROJECT_TARGETS))
<%else%>
<%if(sharedname && !compares(platform, VxWorks))%>
ACE_TARGET_DIR = $(ACE_TARGET_NAME)_$(BUILD_SPEC)
ACE_TARGET_PREFIX = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%dll_prefix%>)<%endfor%>
ACE_TARGET_NAME := <%sharedname%>
ACE_TARGET_EXT = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%dll_ext%>)<%endfor%>
PROJECT_TARGET = $(filter %$(ACE_TARGET_EXT),$(PROJECT_TARGETS))
<%else%>
<%if(staticname || sharedname)%>
ACE_TARGET_PREFIX = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%lib_prefix%>)<%endfor%>
ACE_TARGET_NAME := <%staticname%>
ACE_TARGET_EXT = <%foreach(buildspecs)%>$(if $(filter <%buildspec%>,$(BUILD_SPEC)),<%lib_ext%>)<%endfor%>
PROJECT_TARGET = $(filter %$(ACE_TARGET_EXT),$(PROJECT_TARGETS))
<%endif%>
<%endif%>
<%endif%>
ACE_TARGET_DIR ?= $(ACE_TARGET_NAME)
<%if(custom_only)%>
PROJECT_TARGET = CUSTOM_ONLY
<%endif%>

<%if(libs && libpaths && exename && need_staticflags)%>
DEPLIBS = $(foreach lib,<%foreach(libs)%> <%libname_prefix%><%lib%><%endfor%> <%lit_libs%>, $(foreach libpath,<%foreach(libpaths)%><%if(!standard_build)%> <%if(make_coexistence)%>../../<%else%>../<%endif%><%libpath%><%endif%> <%libpath%><%endfor%>, $(wildcard $(libpath)/lib$(lib).a)))
<%endif%>

<%if(standard_build)%>
all : generate_sources pre_recursion subdirs_all post_recursion pre_build main_all post_build
<%else%>
all : generate_sources pre_build main_all post_build
<%endif%>

<%if(!standard_build)%>
_clean ::
	@echo "make: removing targets and objects of `pwd`"
<%endif%>

%IDE_GENERATED%

<%if(standard_build && exename)%>
$(OBJ_DIR)/<%exename%>_partialImage.o : $(OBJECTS) $(SUB_OBJECTS) $(DEPLIBS)
<%else%>
<%if(!standard_build && libs && libpaths && exename && need_staticflags)%>
$(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT): $(DEPLIBS)
<%endif%>
<%endif%>

<%if(!standard_build)%>
-include $(PRJ_ROOT_DIR)/*.makefile
<%endif%>

-include *.makefile

<%if(custom_only)%>
main_all : external_build
	@echo "make: built targets of `pwd`"
<%else%>
<%if(standard_build)%>
main_all : check_objectdir external_build $(PROJECT_TARGETS)
<%else%>
main_all : external_build $(PROJECT_TARGETS)
<%endif%>
	@echo "make: built targets of `pwd`"
<%endif%>

<%if(standard_build)%>
check_objectdir :
	@if [ ! -d "$(OBJ_DIR)" ]; then\
		mkdir -p $(OBJ_DIR);\
	fi

# main entry point for pre processing prior to the recursion
pre_recursion ::
	@echo ""

# main entry point for post processing after the recursion
post_recursion ::
	@echo ""
<%endif%>

# entry point for extending the build
external_build ::
	@echo ""

# main entry point for pre processing prior to the build
<%if(prebuild)%>
pre_build ::
	@<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%eval(prebuild)%>
<%endif%>
<%if(standard_build)%>
ACE_ALL_OBJECTS := $(SUB_OBJECTS) $(OBJECTS)
ifneq ($(PROJECT_TARGET),)
pre_build :: $(PRE_BUILD_STEP)
	@echo "Create object list $(PRJ_ROOT_DIR)/filelist.txt";\
	rm -f $(PRJ_ROOT_DIR)/filelist.txt;\
	for object in _dummy_ $(ACE_ALL_OBJECTS); do\
		if [ "$$object" = "_dummy_" ]; then\
			continue ;\
		fi;\
		echo "$$object" >> $(PRJ_ROOT_DIR)/filelist.txt;\
	done
else
pre_build :: $(PRE_BUILD_STEP)
	@echo ""
endif
<%else%>
pre_build :: $(PRE_BUILD_STEP)
	@echo "Create object list";\
	rm -f $(PRJ_ROOT_DIR)/filelist.txt;\
<%if(exename)%>
	for object in _dummy_ $(OBJECTS_<%exename%>); do\
<%else%>
	for object in _dummy_ $(OBJECTS_<%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%>); do\
<%endif%>
		if [ "$$object" = "_dummy_" ]; then\
			continue ;\
		fi;\
		echo "$$object" >> $(PRJ_ROOT_DIR)/filelist.txt ;\
	done
<%endif%>


# function for generating the correct Custom type Prerequisite (input or dep)
# using a ../ or ../../ prefix unless it's already an absolute path
CUST_PRE = <%if(!standard_build)%>$(if $(patsubst $%,,$(1:/%=)),<%if(make_coexistence)%>../../<%else%>../<%endif%>)$(1)<%else%>$(1)<%endif%>

# function for adding an exe_ext, if needed and the file exists
ADD_EXT = $(if $(ACE_EXE_EXT),$(if $(suffix $(1)),$(1),$(wildcard $(1) $(1)$(ACE_EXE_EXT))),$(1))

<%if(custom_types)%>
SPACE = $(should_be_unset) $(should_be_unset)
GENERATED_DIRTY =<%if(!standard_build)%> $(addprefix <%if(make_coexistence)%>../../<%else%>../<%endif%>,<%endif%><%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%><%if(!standard_build)%>)<%endif%>
<%else%>
GENERATED_DIRTY =
<%endif%>

# entry point for generating sources prior to the build
<%if(standard_build)%>
ifneq ($(PROJECT_TARGET),)
<%endif%>
generate_sources :: $(GENERATED_DIRTY)

<%foreach(custom_types)%>
<%if(custom_type->libpath)%>
LD_LIBRARY_PATH   := $(LD_LIBRARY_PATH):<%custom_type->libpath%>
PATH              := $(PATH):<%custom_type->libpath%>
<%endif%>

<%foreach(custom_type->input_files)%>
<%if(custom_type->input_file->output_files)%>
<%if(multiple(custom_type->input_file->output_files))%>
.NOTPARALLEL:
<%endif%>
<%if(!standard_build)%>$(addprefix <%if(make_coexistence)%>../../<%else%>../<%endif%>,<%endif%><%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%><%if(!standard_build)%>)<%endif%>: $(foreach pre,<%custom_type->input_file%><%if(custom_type->input_file->dependencies)%><%foreach(custom_type->input_file->dependencies)%><%if(contains(custom_type->input_file->dependencie, \$))%> $(subst $(SPACE),\$(SPACE),<%custom_type->input_file->dependencie%>)<%else%> <%scope(enter, escape, \\s)%><%custom_type->input_file->dependencie%><%scope(leave)%><%endif%><%endfor%><%endif%><%if(flag_overrides(custom_type->input_file, dependent))%><%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%if(contains(dep, \$))%> $(subst $(SPACE),\$(SPACE),<%dep%>)<%else%> <%scope(enter, escape, \\s)%><%dep%><%scope(leave)%><%endif%><%endfor%><%else%><%if(custom_type->dependent)%><%foreach(custom_type->dependent)%><%if(contains(custom_type->dependent, \$))%> $(subst $(SPACE),\$(SPACE),<%custom_type->dependent%>)<%else%> <%scope(enter, escape, \\s)%><%custom_type->dependent%><%scope(leave)%><%endif%><%endfor%><%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))%><%if(contains(dep, \$))%> $(subst $(SPACE),\$(SPACE),<%dirname(dep_lib)%>/<%libname_prefix%><%basename(dep_lib)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%>)<%else%> <%scope(enter, escape, \\s)%><%dirname(dep_lib)%>/<%libname_prefix%><%basename(dep_lib)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%scope(leave)%><%endif%><%endfor%><%if(custom_type->dependent_libs)%><%foreach(custom_type->dependent_libs)%><%if(contains(custom_type->dependent_libs, \$))%> $(subst $(SPACE),\$(SPACE),<%dirname(custom_type->dependent_lib)%>/<%libname_prefix%><%basename(custom_type->dependent_lib)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%>)<%else%> <%scope(enter, escape, \\s)%><%dirname(custom_type->dependent_lib)%>/<%libname_prefix%><%basename(custom_type->dependent_lib)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%scope(leave)%><%endif%><%endfor%><%endif%><%endif%><%endif%>,$(call ADD_EXT,$(call CUST_PRE,$(pre))))
<%if(flag_overrides(custom_type->input_file, gendir))%>
<%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%>
	@<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>test -d "<%flag_overrides(custom_type->input_file, gendir)%>" || mkdir -p "<%flag_overrides(custom_type->input_file, gendir)%>"
<%endif%>
<%endif%>
	$(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%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%><%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%><%else%><%custom_type->input_file%><%endif%>
<%if(flag_overrides(custom_type->input_file, postcommand))%>
<%foreach(custom_type->input_file)%>
	$(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%flag_overrides(custom_type->input_file, postcommand)%>
<%endfor%>
<%else%>
<%if(custom_type->postcommand)%>
<%foreach(custom_type->input_file)%>
	$(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%custom_type->postcommand%>
<%endfor%>
<%endif%>
<%endif%>
<%if(pch_header)%>
<%if(custom_type->pch_postrule)%>
<%foreach(custom_type->input_file->source_output_files)%>
	@<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>echo '#include "<%pch_header%>"' > temp.$$$$ && cat <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%><%slash%><%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)%><%slash%><%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>
<%endfor%>
<%endif%>
<%endif%>
<%endif%>
<%endfor%>
<%endfor%>
<%if(standard_build)%>
else
generate_sources ::
	@echo ""
endif
<%endif%>

DIR_PREFIX = <%if(make_coexistence)%><%dirname(project_file)%>/<%endif%>$(BUILD_SPEC)

# main entry point for post processing after the build
<%if(postbuild)%>
post_build ::
	@<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%eval(postbuild)%>
<%endif%>
post_build :: $(POST_BUILD_STEP) deploy_output
	@echo ""

# entry point for deploying output after the build
<%if(standard_build)%>
ifneq ($(PROJECT_TARGET),)
<%endif%>
<%if(!standard_build)%>
deploy_output :: <%if(exename)%>$(call CUST_PRE,$(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT))<%else%><%if(sharedname || staticname)%><%if(libout || dllout)%>$(call CUST_PRE,$(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT))<%endif%><%endif%><%endif%>
<%if(exename)%>
$(call CUST_PRE,$(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)): $(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)
	$(TRACE_FLAG)<%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%>test -d $(ACE_EXEOUT) || mkdir -p $(ACE_EXEOUT); cp $(DIR_PREFIX)/$(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_EXEOUT)
<%else%>
<%if(sharedname || staticname)%>
<%if(libout || dllout)%>
$(call CUST_PRE,$(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)): $(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)
	$(TRACE_FLAG)<%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%>test -d $(ACE_LIBOUT) || mkdir -p $(ACE_LIBOUT); cp $(DIR_PREFIX)/$(ACE_TARGET_DIR)/$(MODE_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_LIBOUT)
<%endif%>
<%endif%>
<%endif%>
<%else%>
deploy_output ::
<%if(exename)%>
<%if(exeout)%>
	if [ $(ACE_EXEOUT) != . ]; then\
		if [ ! -d $(ACE_EXEOUT) ]; then\
			mkdir -p $(ACE_EXEOUT);\
		fi;\
		if test -e $(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \
			if test $(OBJ_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) -nt $(ACE_EXEOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \
				cp $(OBJ_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_EXEOUT);\
			fi \
		else \
			cp $(OBJ_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_EXEOUT);\
		fi\
	fi
<%endif%>
<%else%>
<%if(sharedname || staticname)%>
<%if(libout || dllout)%>
	if [ $(ACE_LIBOUT) != . ]; then\
		if [ ! -d $(ACE_LIBOUT) ]; then\
			mkdir -p $(ACE_LIBOUT);\
		fi;\
		if test -e $(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \
			if test $(OBJ_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) -nt $(ACE_LIBOUT)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT); then \
				cp $(OBJ_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_LIBOUT);\
			fi \
		else \
				cp $(OBJ_DIR)/$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT) $(ACE_LIBOUT);\
		fi\
	fi
<%endif%>
<%endif%>
<%endif%>
<%endif%>
	@echo ""
<%if(standard_build)%>
else
deploy_output ::
	@echo ""
endif
<%endif%>

<%if(standard_build)%>

# order subdirs to use subprojects first
isSubProject = $(if $(subst $(subst $(CURDIR)/,,$(dir)),,$(dir)),, $(dir))
SUB_PROJECTS := $(foreach dir, $(SUBDIRS), $(isSubProject))
isSubFolder = $(if $(subst $(subst $(CURDIR)/,,$(dir)),,$(dir)), $(dir))
SUB_FOLDERS := $(foreach dir, $(SUBDIRS), $(isSubFolder))

SUBDIRS_ORDERED := $(SUB_PROJECTS) $(SUB_FOLDERS)

# recursive make in SUBDIRS
subdirs_all :
	@_PWD=`pwd`;\
	for dir in _dummy_ $(SUBDIRS_ORDERED); do\
		if [ "$$dir" = "_dummy_" ]; then\
			continue ;\
	fi;\
		if [ ! -d "$$dir" ]; then\
			continue ;\
	fi;\
	echo "Recursive make: Changing to Directory '$$dir'";\
	cd "$$dir";\
		"$(MAKE)" -f "$(MAKEFILE)" $(MFLAGS) all || exit;\
		echo "Recursive make: Changing back to Directory '$$_PWD'";\
		cd "$$_PWD";\
	done

clean ::
	@_PWD=`pwd`;\
	for dir in _dummy_ $(SUBDIRS_ORDERED); do\
		if [ "$$dir" = "_dummy_" ]; then\
			continue ;\
		fi;\
		if [ ! -d "$$dir" ]; then\
			continue ;\
		fi;\
		echo "Recursive make: Changing to Directory '$$dir'";\
		cd "$$dir";\
		"$(MAKE)" -f "$(MAKEFILE)" $(MFLAGS) $@ || exit;\
		echo "Recursive make: Changing back to Directory '$$_PWD'";\
		cd "$$_PWD";\
	done
<%endif%>

clean :: external_clean $(CLEAN_STEP) _clean

# entry point for extending the build clean
<%if(standard_build)%>
ifneq ($(PROJECT_TARGET),)
<%endif%>
external_clean ::
<%foreach(custom_types)%>
<%foreach(custom_type->input_files)%>
<%if(custom_type->input_file->output_files)%>
	$(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>rm -f <%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%>
<%if(exename)%>
<%if(exeout || !standard_build)%>
	$(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>rm -f <%exeout(".")%>/$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)
<%endif%>
<%else%>
<%if(sharedname || staticname)%>
	$(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%>rm -f <%if(dllout)%><%dllout%>/<%else%><%libout%>/<%endif%>$(ACE_TARGET_PREFIX)$(ACE_TARGET_NAME)$(ACE_TARGET_EXT)
<%endif%>
<%endif%>
<%if(postclean)%>
	$(TRACE_FLAG)<%if(!standard_build)%><%if(make_coexistence)%>cd ../.. ; <%else%>cd .. ; <%endif%><%endif%><%eval(postclean)%>
<%endif%>
	@echo ""
<%if(standard_build)%>
else
external_clean ::
	@echo ""
endif
<%endif%>


<%if(standard_build)%>
_clean :
	if [ -d $(OBJ_DIR) ]; then\
		echo "make: removing targets and objects of `pwd`";\
		rm -f $(OBJECTS) $(PROJECT_TARGETS) $(DEP_FILES) $(wildcard $(OBJ_DIR)/*.unstripped) $(wildcard $(OBJ_DIR)/ctdt.*) \
		rm -rf $(OBJ_DIR);\
		rm -f $(PRJ_ROOT_DIR)/filelist.txt;\
	else\
		echo "make: removing targets and objects of `pwd`, already done";\
	fi

build_all_specs :
	@echo "building target default for ALL build-specs";\
	for spec in _dummy_ $(ALL_BUILD_SPECS); do\
		if [ "$$spec" = "_dummy_" ]; then\
			continue ;\
		fi;\
		echo " ";\
		echo "building all for build-spec '$$spec'";\
		"$(MAKE)" -f "$(MAKEFILE)" $(MFLAGS) BUILD_SPEC=$$spec DEBUG_MODE=$(DEBUG_MODE) TRACE=$(TRACE) || exit;\
	done

clean_all_specs :
	@echo "building target clean for ALL build-specs";\
	for spec in _dummy_ $(ALL_BUILD_SPECS); do\
		if [ "$$spec" = "_dummy_" ]; then\
			continue ;\
		fi;\
		echo " ";\
		echo "building clean for build-spec '$$spec'";\
		"$(MAKE)" -f "$(MAKEFILE)" $(MFLAGS) BUILD_SPEC=$$spec DEBUG_MODE=$(DEBUG_MODE) TRACE=$(TRACE) clean || exit;\
	done

build_enabled_specs :
	@echo "building target default for ENABLED build-specs";\
	for spec in _dummy_ $(ENABLED_BUILD_SPECS); do\
		if [ "$$spec" = "_dummy_" ]; then\
			continue ;\
		fi;\
		echo " ";\
		echo "building all for build-spec '$$spec'";\
		"$(MAKE)" -f "$(MAKEFILE)" $(MFLAGS) BUILD_SPEC=$$spec DEBUG_MODE=$(DEBUG_MODE) TRACE=$(TRACE) || exit;\
	done

clean_enabled_specs :
	@echo "building target clean for ENABLED build-specs";\
	for spec in _dummy_ $(ENABLED_BUILD_SPECS); do\
		if [ "$$spec" = "_dummy_" ]; then\
			continue ;\
		fi;\
		echo " ";\
		echo "building clean for build-spec '$$spec'";\
		"$(MAKE)" -f "$(MAKEFILE)" $(MFLAGS) BUILD_SPEC=$$spec DEBUG_MODE=$(DEBUG_MODE) TRACE=$(TRACE) clean || exit;\
	done
<%endif%>

<%if(standard_build)%>
<%if(sharedname || staticname)%>
ifneq ($(PROJECT_TARGET),)
$(OBJ_DIR)/<%lib_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%lib_ext%> : $(OBJECTS) $(SUB_OBJECTS)
endif
<%endif%>
<%endif%>
<%endfor%>
