#
# Targets
#

# Place the .so file in DEST
DEST          = $(SNS_ROOT)/lib

# List of the source-files in this directory
SRCS          = ReplicationEventStub.cpp \
				SipReplicaPayload.cpp \
				SIPCON-replica_payload.cpp \
				ComponentStateManager.cpp

# Object-files that are derived from the sources
OBJS          = $(SRCS:%.cpp=%.o)
GENS	=	SIPCON-replica_payload.h SIPCON-replica_payload.cpp



# Directories to search for header-files
INCL          = -DRTR_UNIT_TEST -DSERVER_COMMON_APP_DLL= $(SSPINCL) $(ASNINCL) \
		-I$(SNS_ROOT)/src/sipha \
		-I$(SNS_ROOT)/src/ha \
		-I$(SNS_ROOT)/src/event \
		-I$(SNS_ROOT)/src/networkcall \
		-I$(SNS_ROOT)/src/sicc \
		-I$(SNS_ROOT)/src/sipstack \
		-I$(SNS_ROOT)/src/utils \
		-I$(SNS_ROOT)/src/connector \
		-I$(SNS_ROOT)/src/condition \
		-I$(SNS_ROOT)/src/sipconn \
		-I$(SNS_ROOT)/src/sippresence \
        -I$(SNS_ROOT)/src/statistics \
		-I$(CSN_ROOT)/infrastructure/failover/status/c++/src \
		-I$(CSN_ROOT)/infrastructure/failover/role/c++/src \
		-I$(CSN_ROOT)/infrastructure/replication/c++/src \
		-I$(CSN_ROOT)/infrastructure/replication/c++/src/comm \
		-I$(UTL_ROOT)/src/include \
		-I$(UTL_ROOT)/src/libOam \
		-I$(UTL_ROOT)/src/libeICC \
		-I$(ORACLE_HOME)/precomp/public

# Libraries to link against
LIBS	      	= $(ASNLIB) -lasn1ber -lasn1rt

# Name of the .so to produce
LIBNAME       = libSnsSipHA

include $(UTL_ROOT)/MakeIncl/Makeflags.$(PNX_OS)
include $(UTL_ROOT)/MakeIncl/MakeLib

.NOTPARALLEL:
#
# Special case: ASN.1 code generation
#
generate: $(GENS)

$(GENS): SIPCON-replica_payload.asn
	$(ASN) *.asn  $(ASNFLAGS)


# Take any OBJS files with .o and use the .cpp to create them
$(CSN_ROOT)/infrastructure/failover/role/c++/lib/libFailoverRole.so:
	(cd $(CSN_ROOT)/infrastructure/failover/role/c++/src && $(MAKE) install) || exit 1;

$(CSN_ROOT)/infrastructure/replication/c++/lib/libReplication.so:
	(cd $(CSN_ROOT)/infrastructure/replication/c++/src && $(MAKE) install) || exit 1;

ReplicationEventStub.o: ReplicationEventStub.cpp $(CSN_ROOT)/infrastructure/replication/c++/lib/libReplication.so
	$(CPP) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

ComponentStateManager.o: ComponentStateManager.cpp $(CSN_ROOT)/infrastructure/failover/role/c++/lib/libFailoverRole.so
	$(CPP) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    
$(OBJS): %.o: %.cpp


