# -*- Makefile -*-
#----------------------------------------------------------------------------
#       GNU Makefile
#
# @file <%project_file%>
#
# $Id: gnu.mpd 77593 2007-03-07 16:38:39Z elliott_c $
#
# 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<%libname_prefix%><%staticname%>.a
LIB              = $(LIB_UNCHECKED)
LIB_NAME         = lib<%libname_prefix%><%staticname%>
<%if(!sharedname)%>
static_libs_only = 1
<%endif%>
<%endif%>
<%if(sharedname)%>

## SHLIB may be set to empty later on in this file
SHLIB_UNCHECKED  = lib<%libname_prefix%><%sharedname%>.$(SOEXT)
SHLIB            = $(SHLIB_UNCHECKED)
<%endif%>
<%if(tao || ciao)%>

TAO_ROOT  ?= $(ACE_ROOT)/TAO
<%if(ciao)%>
CIAO_ROOT ?= $(TAO_ROOT)/CIAO
<%endif%>
<%endif%>

<%if(grouped_source_files)%>
<%foreach(grouped_source_files)%>
<%grouped_source_file%> = \
<%foreach(grouped_source_file->files)%>
  <%grouped_source_file->file%><%fornotlast(" \\")%>
<%endfor%>

<%endfor%>
FILES += \
<%foreach(grouped_source_files)%>
         $(<%grouped_source_file%>)<%fornotlast(" \\")%>
<%endfor%>

<%else%>
FILES = \
<%foreach(source_files)%>
  <%source_file%><%fornotlast(" \\")%>
<%endfor%>

<%endif%>
<%vpath%>
#----------------------------------------------------------------------------
#       Include macros and targets
#----------------------------------------------------------------------------
<%marker(macros)%>
<%if(xerceslib)%>
XERCESLIB ?= <%xerceslib%>
<%endif%>
<%if(exename)%>
LDLIBS =<%foreach(libs)%> -l<%libname_prefix%><%lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
<%else%>
<%if(sharedname)%>
ACE_SHLIBS =<%foreach(libs)%> -l<%libname_prefix%><%lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
<%endif%>
<%endif%>
<%if(tao_idl)%>
TAO_IDL = <%tao_idl%>
<%endif%>
<%if(tao_idl_dep)%>
TAO_IDL_DEP = <%tao_idl_dep%>$(EXEEXT)
<%endif%>
<%if(tao_idlflags)%>
TAO_IDLFLAGS = <%tao_idlflags%>
<%endif%>
<%if(cidlc)%>
CIDLC = <%cidlc%>
<%endif%>
<%if(cidlc_dep)%>
CIDLC_DEP = <%cidlc_dep%>$(EXEEXT)
<%endif%>
<%if(cidlc_flags)%>
CIDLC_FLAGS = <%cidlc_flags%>
<%endif%>
<%if(xsc_bin)%>
XSC_BIN = <%xsc_bin%>
<%endif%>
<%if(xsc_dep)%>
XSC_DEP = <%xsc_dep%>$(EXEEXT)
<%endif%>
<%if(xsc_flags)%>
XSC_FLAGS = <%xsc_flags%>
<%endif%>
<%if(tao_idl3_to_idl2)%>
TAO_IDL3_TO_IDL2 = <%tao_idl3_to_idl2%>
<%endif%>
<%if(tao_idl3_to_idl2_dep)%>
TAO_IDL3_TO_IDL2_DEP = <%tao_idl3_to_idl2_dep%>$(EXEEXT)
<%endif%>

<%if(exename)%>
PRJ_TYPE = rtp
<%else%>
PRJ_TYPE = library
<%endif%>

<%if(exename)%>
<%if(install)%>
INSBIN ?= <%install%>
<%endif%>
ifeq ($(INSBIN),.)
  ifeq ($(PWD),)
    PWD=$(shell pwd)
  endif
  INSBIN = $(PWD)<%if(targetoutdir)%>/<%targetoutdir%><%endif%>
<%if(targetoutdir)%>
else
  ifneq ($(INSBIN),)
    INSBIN := $(INSBIN)/<%targetoutdir%>
  endif
<%endif%>
endif
OUTPUT_DIRECTORY = $(INSBIN)
<%else%>
<%if(dllout || libout)%>
INSLIB ?= <%if(dllout)%><%dllout%><%else%><%libout%><%endif%>
<%endif%>
ifeq ($(INSLIB),.)
  ifeq ($(PWD),)
    PWD=$(shell pwd)
  endif
  INSLIB = $(PWD)<%if(targetoutdir)%>/<%targetoutdir%><%endif%>
<%if(targetoutdir)%>
else
  INSLIB := $(INSLIB)/<%targetoutdir%>
<%endif%>
endif
OUTPUT_DIRECTORY = $(INSLIB)
<%endif%>

<%if(targetoutdir)%>
VDIR   = <%targetoutdir%>.obj/
VSHDIR = <%targetoutdir%>.shobj/

<%endif%>
include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
<%if(!dds && version)%>

ifeq ($(versioned_so),1)
  SOVERSION = .<%version%>
endif # versioned_so

<%endif%>
<%if(dds)%>
include $(DDS_ROOT)/rules.dds.GNU
<%endif%>
<%if(ciao)%>
include $(CIAO_ROOT)/rules.ciao.GNU
<%endif%>
<%if(tao)%>
include $(TAO_ROOT)/rules.tao.GNU
<%endif%>

<%if(resource_files)%>
ifneq (,$(RC))
RESOURCES += \
<%foreach(resource_files)%>
  <%resource_file%><%fornotlast(" \\")%>
<%endfor%>
<%if(includes)%>

RCFLAGS = \
<%foreach(includes)%>
        --include-dir=<%include%><%fornotlast(" \\")%>
<%endfor%>
<%endif%>
endif

<%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

ifneq ($(OUTPUT_DIRECTORY),)
all: $(OUTPUT_DIRECTORY)
$(OUTPUT_DIRECTORY):
	-@$(MKDIR) "$(OUTPUT_DIRECTORY)"
endif

<%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,<%foreach(libs)%><%libname_prefix%><%lib%><%fornotlast(" ")%><%endfor%>,$(findstring $(lib),$(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%><%libpath%>/<%targetoutdir%> <%endif%><%libpath%> <%endfor%>/usr/lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),<%foreach(libs)%><%libname_prefix%><%lib%><%fornotlast(" ")%><%endfor%>)
    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%>

# If it contains ../ at all use notdir.
OBJS   = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var)))
SRC    = $(FILES)
<%endif%>
<%if(sharedname || staticname)%>
LSRC   = $(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(exename)%>

ifneq ($(OUTPUT_DIRECTORY),)
ifneq ($(OUTPUT_DIRECTORY),.)
  INSTALL = $(VBIN:%=$(INSBIN)/%)
  CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/%$(VAR)$(EXEEXT))
endif
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
ifeq ($(VXWORKSLINK),true)
include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE)
endif

<%foreach(source_files)%>
<%if(flag_overrides(source_file, buildflags))%>
$(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
	@$(MKDIR) $(VDIR)<%dirname(source_file)%>
	<%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%flag_overrides(source_file, buildflags)%> $(ACE_USE_PCH_OPT) $(CC_OUTPUT_FLAG) $@ $<
	${MVCMD}

ifneq ($(VSHDIR), $(VDIR))
$(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
	@$(MKDIR) $(VSHDIR)<%dirname(source_file)%>
	<%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%flag_overrides(source_file, buildflags)%> $(ACE_USE_PCH_OPT) $(PIC) $(CC_OUTPUT_FLAG) $@ $<
endif

<%else%>
<%if(dirname(source_file) && !contains(source_file, \.\./))%>
<%if(starts_with(source_file, \$) || !ends_with(source_file, \.cpp))%>
$(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
	@$(MKDIR) $(VDIR)<%dirname(source_file)%>
	<%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(ACE_USE_PCH_OPT) $(CC_OUTPUT_FLAG) $@ $<
	${MVCMD}

ifneq ($(VSHDIR), $(VDIR))
$(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
	@$(MKDIR) $(VSHDIR)<%dirname(source_file)%>
	<%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(ACE_USE_PCH_OPT) $(PIC) $(CC_OUTPUT_FLAG) $@ $<
endif

<%endif%>
<%endif%>
<%endif%>
<%endfor%>
<%if(libpaths)%>
ifeq ($(VXWORKSLINK),true)
LDLIBPATH     =<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%><%endfor%><%if(linkflags)%> <%linkflags%><%endif%>
else
LDFLAGS      +=<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%><%endfor%><%if(linkflags)%> <%linkflags%><%endif%>
endif
<%endif%>
<%if(includes)%>
CPPFLAGS     +=<%foreach(includes)%> -I<%include%><%endfor%>
<%endif%>
<%if(macros)%>
CPPFLAGS     +=<%foreach(macros)%> -D<%macro%><%endfor%>
<%endif%>
<%if(compile_flags)%>
CPPFLAGS     += <%compile_flags%>
<%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%>
<%if(exename && link_groups)%>
  ifeq ($(notdir $(CXX)), g++)
    LDLIBS := -Wl,--start-group $(LDLIBS) -Wl,--end-group
  endif
<%endif%>
endif
<%endif%>

#----------------------------------------------------------------------------
#       Local targets
#----------------------------------------------------------------------------
<%marker(local)%>
lib_warning:
	@echo <%project_name%> will not be built due to the following missing library:
	@echo $(LIBCHECK)

<%if(requires)%>
require_warning:
	@echo <%project_name%> will not be built due to one of the following disabled make macros:
	@echo<%foreach(requires)%> <%require%><%endfor%>

<%endif%>
<%if(avoids)%>
avoid_warning:
	@echo <%project_name%> will not be built due to one of the following enabled make macros:
	@echo<%foreach(avoids)%> <%avoid%><%endfor%>

<%endif%>
<%if(custom_types)%>
## Some OS's have /bin/test others only have /usr/bin/test
ifeq ($(wildcard /bin/test), /bin/test)
  TEST_EXE = /bin/test
else
ifeq ($(wildcard /usr/bin/test), /usr/bin/test)
  TEST_EXE = /usr/bin/test
endif
endif

<%foreach(custom_types)%>
<%if(custom_type->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))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%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
  ifneq ($(TEST_EXE),)
    ## 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)%> $(TEST_EXE) <%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(flag_overrides(custom_type->input_file, 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(dep, flag_overrides(custom_type->input_file, dependent))%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) <%dep%> -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%><%endfor%> echo 0),)
        .NOTPARALLEL:
      endif
<%else%>
<%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->dependent)%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) <%custom_type->dependent%> -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%><%endfor%> echo 0),)
        .NOTPARALLEL:
      endif
<%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))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%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(flag_overrides(custom_type->input_file, gendir))%>
<%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%>
	$(MKDIR) <%flag_overrides(custom_type->input_file, gendir)%>
<%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%> $@<%else%><%custom_type->input_file%><%endif%>
<%if(flag_overrides(custom_type->input_file, postcommand))%>
<%foreach(custom_type->input_file)%>
	<%flag_overrides(custom_type->input_file, postcommand)%>
<%endfor%>
<%else%>
<%if(custom_type->postcommand)%>
<%foreach(custom_type->input_file)%>
	<%custom_type->postcommand%>
<%endfor%>
<%endif%>
<%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)
$(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY)
$(VSHDIR)$(ACE_PCH_FILE) $(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)%>
ADDITIONAL_IDL_TARGETS +=<%foreach(idl_files)%> <%if(flag_overrides(idl_file, gendir))%><%if(!compares(flag_overrides(idl_file, gendir),.))%><%flag_overrides(idl_file, gendir)%>/<%endif%><%basenoextension(idl_file)%>$(IDL_CLIENT_HDR_EXT)<%else%><%noextension(idl_file)%>$(IDL_CLIENT_HDR_EXT)<%endif%><%endfor%>
idl_stubs: $(ADDITIONAL_IDL_TARGETS)
<%if(source_files)%>

# This assignment forces make to run the idl_stubs
# target before building any of the source files.
FORCED_IDL_STUBS = <%source_files%>  <%if(pch_source)%>$(ACE_PCH_SOURCE)<%endif%>
<%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))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%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)%>

ifneq ($(VXWORKSLINK),true)
<%if(libs && libpaths)%>
ifeq ($(static_libs_only), 1)
  ifeq ($(use_dep_libs), 1)
    DEPLIBS = $(foreach lib,<%foreach(libs)%> <%libname_prefix%><%lib%><%endfor%> <%lit_libs%>, $(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%> <%libpath%>/<%targetoutdir%><%endif%> <%libpath%><%endfor%>, $(wildcard $(libpath)/lib$(lib).a)))
  endif
endif

<%endif%>
$(BIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS)
	$(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK)
endif
<%endif%>

realclean: clean
ifneq ($(GENERATED_DIRTY),)
	-$(RM) -r $(GENERATED_DIRTY)
endif

__prebuild__:
<%if(prebuild)%>
	@<%eval(prebuild)%>
<%else%>
	@-:
<%endif%>

<%if(postbuild)%>
all: __postbuild__

__postbuild__:
	@<%eval(postbuild)%>

<%endif%>
<%marker(bottom)%>
