# -*- Makefile -*-
#----------------------------------------------------------------------------
#       GNU Makefile
#
# @file GNUmakefile.Faults_Ping
#
# gnu.mpd,v 1.95 2004/07/01 19:00:58 elliott_c Exp
#
# This file was automatically generated by MPC.  Any changes made directly to
# this file will be lost the next time it is generated.
#
#----------------------------------------------------------------------------
MAKEFILE         = GNUmakefile.Faults_Ping
DEPENDENCY_FILE  = .depend.Faults_Ping
BIN_UNCHECKED    = ping

ifndef TAO_ROOT
  TAO_ROOT = $(ACE_ROOT)/TAO
endif
ifndef CIAO_ROOT
  CIAO_ROOT = $(TAO_ROOT)/CIAO
endif

FILES = \
  pingC \
  pingS \
  ping_i \
  ping

#----------------------------------------------------------------------------
#       Include macros and targets
#----------------------------------------------------------------------------
LDLIBS = -lTAO_PortableServer -lTAO_IORInterceptor -lTAO_ObjRefTemplate -lTAO_Valuetype -lTAO -lACE
TAO_IDL = ../../../bin/tao_idl
TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT)

include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
## We don't need the ACELIB setting from wrapper_macros.GNU
ACELIB =
tao_dont_use_idl_make_rule = 1
include $(TAO_ROOT)/rules.tao.GNU

# 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)/Faults_Ping

all: $(TEMPINCDIR)

endif

INSBIN ?= .
OUTPUT_DIRECTORY = $(INSBIN)
all: $(OUTPUT_DIRECTORY)

$(OUTPUT_DIRECTORY):
	-@mkdir -p "$(OUTPUT_DIRECTORY)"

# 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,TAO_PortableServer TAO_IORInterceptor TAO_ObjRefTemplate TAO_Valuetype TAO ACE,$(findstring $(lib),$(foreach libpath,../../../lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),TAO_PortableServer TAO_IORInterceptor TAO_ObjRefTemplate TAO_Valuetype TAO ACE)
    ifeq ($(LIBCHECK),)
      LIBCHECK = 1
    endif
  endif
endif
ifneq ($(minimum_corba),1)
ifeq ($(LIBCHECK), 1)
BIN    = $(BIN_UNCHECKED)
else
  all: lib_warning
endif
else
  all: avoid_warning
endif

OBJS   = $(addsuffix .o, $(notdir $(FILES)))
SRC    = $(addsuffix .cpp, $(FILES))
ifneq (,$(RC))
  FILES += $(RESOURCES)
endif


include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
include $(TAO_ROOT)/taoconfig.mk

LDFLAGS      += -L../../../lib
CPPFLAGS     += -I../../.. -I$(TAO_ROOT)
ifeq ($(static_libs),1)
  CPPFLAGS += -DACE_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS
endif

#----------------------------------------------------------------------------
#       Local targets
#----------------------------------------------------------------------------
lib_warning:
	@echo This project will not be built due to the following missing library:
	@echo $(LIBCHECK)

avoid_warning:
	@echo This project will not be built due to one of the following enabled features:
	@echo minimum_corba

DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):../../../lib
LD_LIBRARY_PATH   := $(LD_LIBRARY_PATH):../../../lib
SHLIB_PATH        := $(SHLIB_PATH):../../../lib
LIBPATH           := $(LIBPATH):../../../lib
PATH              := $(PATH):../../../lib

GENERATED_DIRTY += pingC.inl pingS.inl pingS_T.inl pingC.h pingS.h pingS_T.h pingC.cpp pingS.cpp pingS_T.cpp
OBJS_DEPEND_ON_GENERATED = 1
## 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 /bin/test ping.idl -nt pingC.inl 2> /dev/null && /bin/test ping.idl -nt pingS.inl 2> /dev/null && /bin/test ping.idl -nt pingS_T.inl 2> /dev/null && /bin/test ping.idl -nt pingC.h 2> /dev/null && /bin/test ping.idl -nt pingS.h 2> /dev/null && /bin/test ping.idl -nt pingS_T.h 2> /dev/null && /bin/test ping.idl -nt pingC.cpp 2> /dev/null && /bin/test ping.idl -nt pingS.cpp 2> /dev/null && /bin/test ping.idl -nt pingS_T.cpp 2> /dev/null && echo 0),)
      .NOTPARALLEL:
    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 /bin/test $(TAO_IDL)$(EXEEXT) -nt pingC.inl 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingS.inl 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingS_T.inl 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingC.h 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingS.h 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingS_T.h 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingC.cpp 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingS.cpp 2> /dev/null && /bin/test $(TAO_IDL)$(EXEEXT) -nt pingS_T.cpp 2> /dev/null && echo 0),)
        .NOTPARALLEL:
      endif
    endif
  else
    .NOTPARALLEL:
  endif
else
.NOTPARALLEL:
endif
pingC.inl pingS.inl pingS_T.inl pingC.h pingS.h pingS_T.h pingC.cpp pingS.cpp pingS_T.cpp: ping.idl $(TAO_IDL)$(EXEEXT)
	$(TAO_IDL) $(TAO_IDLFLAGS) ping.idl 

ifneq ($(GENERATED_DIRTY),)
.PRECIOUS: $(GENERATED_DIRTY)
## 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
endif

ADDITIONAL_IDL_TARGETS += ping$(IDL_CLIENT_HDR_EXT)
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 = pingC.cpp pingS.cpp ping_i.cpp ping.cpp
FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:pingC.cpp=)
FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:pingS.cpp=)
FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:pingS_T.cpp=)

ifneq ($(FORCED_IDL_STUBS),)
$(FORCED_IDL_STUBS): idl_stubs
endif

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

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

