ARCH            = OS
SHOBJ           = YES

include ../include/makeinclude/Makefile.$(ARCH)

# ******************************************************************************
# * Due to a change in the operating system, the CXX compiler for HP-UX may
# * be different depending on which platform is used.
# ******************************************************************************
ifeq ($(OS_MAJOR), 09)
	CXX := /usr/bin/CC
	HP_FLAGS = -Aa -pta -ptb -D_SELECT_USES_INT_
endif

ifeq ($(OS_MAJOR).$(OS_MINOR), 10.10)
	CXX := /opt/CC/bin/CC 
	HP_FLAGS = -Aa -pta -ptb -Dvolatile=""
        NETLIBS  = -lxti
endif

ifeq ($(OS_MAJOR).$(OS_MINOR), 10.20)
	CXX := /opt/aCC/bin/aCC 
	HP_FLAGS = +W302,749,829
        NETLIBS  = -lxti
endif

APPNAME       = "Lite Client Interface"
DEBUG         = -g
CXXFLAGS      = -D_NO_CDEV_SYSTEM_ -z $(CXXEXTRA) $(SELECTFLAG) $(CXXINCLUDES) $(OS_VERSION_DEF) $(DEBUG) $(HP_FLAGS)
LDFLAGS       = -Wl,+s 
AR            = ar
ARFLAGS       = ruv
RANLIB        = true
DLD           = $(CXX)
SOFLAGS       = -b -Wl,+s
PIC           = +z
SHARED_EXT    = sl
OSLIBS        = -ll -ly -lm


CXXINCLUDES   = -I./ -I../include

PERMLINKS     =  ClientInfo.h\
		cdevMessage.cc \
		 cdevMessage.h \
		 cdevMessageBinary.cc \
		 cdevMessageBinary.h \
		 cdevPacket.cc \
		 cdevPacket.h \
		 cdevPacketBinary.h \
		 AddressIndex.h \
		 ServerInterface.cc \
		 ServerInterface.h \
		 ServerHandler.cc \
		 ServerHandler.h \
		 ErrorReporter.h \
		 SocketUtil.h \
		 SignalManager.cc \
		 SignalManager.h \
                 fifo.cc \
		 fifo.h \
		 clipMagicNumber.h \
		 cdevCommon.h \
		 cdevClock.cc \
		 cdevClock.h \
		 cdevTimeValue.cc \
		 cdevTimeValue.h \
		 cdevStrHash.cc \
		 cdevStrHash.h \
		 cdevIntHash.cc \
		 cdevIntHash.h \
                 cdevSlist.cc \
		 cdevSlist.h \
		 cdevErrCode.h \
		 cdevSpec.h \
		 cdevData.cc \
		 cdevData.h \
		 cdevData.i \
		 cdevDataEntry.cc \
		 cdevDataEntry.h \
		 cdevGlobalTagTable.cc \
		 cdevGlobalTagTable.h \
		 cdevTagTable.cc \
		 cdevTagTable.h \
		 cdevTypes.h \
		 xdrClass.h\
		 cdevAddr.cc\
		 cdevAddr.h\
		 cdevEventHandler.cc\
		 cdevEventHandler.h\
		 cdevHandleSet.cc\
		 cdevHandleSet.h\
		 cdevPlatforms.h\
		 cdevReactor.cc\
		 cdevReactor.h\
		 cdevSocket.cc\
		 cdevSocket.h\
		 cdevSocketAcceptor.cc\
		 cdevSocketAcceptor.h\
		 cdevSocketConnector.cc\
		 cdevSocketConnector.h\
		 cdevSocketDatagram.cc\
		 cdevSocketDatagram.h\
		 cdevSocketStream.cc\
		 cdevSocketStream.h\
		 cdevStreamNode.cc\
		 cdevStreamNode.h\
		 cdevStreamQueue.cc\
		 cdevStreamQueue.h\
		 cdevTime.cc\
		 cdevTime.h\
		 StringHash.h
		 
OBJS           = $(OBJDIR)/ServerHandler.o \
		 $(OBJDIR)/ServerInterface.o \
		 $(OBJDIR)/cdevClock.o \
		 $(OBJDIR)/cdevData.o \
		 $(OBJDIR)/cdevDataEntry.o \
		 $(OBJDIR)/cdevGlobalTagTable.o \
		 $(OBJDIR)/cdevIntHash.o \
		 $(OBJDIR)/cdevMessage.o \
		 $(OBJDIR)/cdevMessageBinary.o \
		 $(OBJDIR)/cdevPacket.o \
		 $(OBJDIR)/cdevSlist.o \
		 $(OBJDIR)/cdevStrHash.o \
		 $(OBJDIR)/cdevTagTable.o \
		 $(OBJDIR)/cdevTimeValue.o\
		 $(OBJDIR)/SignalManager.o\
		 $(OBJDIR)/cdevReactor.o\
		 $(OBJDIR)/cdevEventHandler.o\
		 $(OBJDIR)/cdevSocketStream.o
		  
# ******************************************************************************
# * The BINARIES definition names all of the binary files that should be deleted
# * whenever "make clean" is executed.
# ******************************************************************************
BINARIES    = $(PERMLINKS) $(CDEVLIB)/libcdevClientLite.$(SHARED_EXT) \
              $(CDEVLIB)/libcdevClientLite.a

ifeq ($(SHOBJ),YES)
       TARGETS = $(PERMLINKS) $(CDEVLIB)/libcdevClientLite.$(SHARED_EXT)
else
       TARGETS = $(PERMLINKS) $(CDEVLIB)/libcdevClientLite.a
endif

targets : $(TARGETS)
		
links : $(PERMLINKS)

$(PERMLINKS) : 
	@cp $^ $@

$(CDEVLIB)/libcdevClientLite.a : $(OBJS)
	$(LINK.a) $@ $(OBJS)
	@$(RANLIB) $@ > /dev/null

$(CDEVLIB)/libcdevClientLite.$(SHARED_EXT) : $(OBJS)
	@$(LINK.so) -o $@ $^

ClientInfo.h		: ../common/ClientInfo.h
cdevMessage.cc		: ../cdevPacket/cdevMessage.cc
cdevMessageBinary.cc	: ../cdevPacket/cdevMessageBinary.cc
cdevPacket.cc		: ../cdevPacket/cdevPacket.cc
cdevMessage.h		: ../cdevPacket/cdevMessage.h
cdevMessageBinary.h	: ../cdevPacket/cdevMessageBinary.h
cdevPacket.h		: ../cdevPacket/cdevPacket.h
cdevPacketBinary.h	: ../cdevPacket/cdevPacketBinary.h
AddressIndex.h		: ../common/AddressIndex.h
ServerInterface.cc	: ../cdevClient/ServerInterface.cc
ServerInterface.h	: ../cdevClient/ServerInterface.h
ServerHandler.cc	: ../cdevClient/ServerHandler.cc
ServerHandler.h		: ../cdevClient/ServerHandler.h
ErrorReporter.h		: ../common/ErrorReporter.h
SocketUtil.h		: ../common/SocketUtil.h
SignalManager.cc	: ../common/SignalManager.cc
SignalManager.h		: ../common/SignalManager.h
fifo.cc			: ../common/fifo.cc
fifo.h			: ../common/fifo.h
cdevPlatforms.h		: ../common/cdevPlatforms.h
clipMagicNumber.h	: ../common/clipMagicNumber.h
cdevCommon.h		: ../../../src/common/cdevCommon.h
cdevClock.cc		: ../../../src/common/cdevClock.cc
cdevClock.h		: ../../../src/common/cdevClock.h
cdevTimeValue.cc	: ../../../src/common/cdevTimeValue.cc
cdevTimeValue.h		: ../../../src/common/cdevTimeValue.h
cdevStrHash.cc		: ../../../src/common/cdevStrHash.cc
cdevStrHash.h		: ../../../src/common/cdevStrHash.h
cdevIntHash.cc		: ../../../src/common/cdevIntHash.cc
cdevIntHash.h		: ../../../src/common/cdevIntHash.h
cdevSlist.cc		: ../../../src/common/cdevSlist.cc
cdevSlist.h		: ../../../src/common/cdevSlist.h
cdevSpec.h		: ../../../src/common/cdevSpec.h
cdevErrCode.h		: ../../../src/system/cdevErrCode.h
cdevData.cc		: ../../../src/cdevIO/cdevData.cc
cdevData.h		: ../../../src/cdevIO/cdevData.h
cdevData.i		: ../../../src/cdevIO/cdevData.i
cdevDataEntry.cc	: ../../../src/cdevIO/cdevDataEntry.cc
cdevDataEntry.h 	: ../../../src/cdevIO/cdevDataEntry.h
cdevGlobalTagTable.cc	: ../../../src/cdevIO/cdevGlobalTagTable.cc
cdevGlobalTagTable.h	: ../../../src/cdevIO/cdevGlobalTagTable.h
cdevTagTable.cc 	: ../../../src/cdevIO/cdevTagTable.cc
cdevTagTable.h		: ../../../src/cdevIO/cdevTagTable.h
cdevTypes.h		: ../../../src/cdevIO/cdevTypes.h
xdrClass.h		: ../../../src/cdevIO/xdrClass.h
cdevAddr.cc		: ../cdevReactor/cdevAddr.cc
cdevAddr.h		: ../cdevReactor/cdevAddr.h
cdevEventHandler.cc	: ../cdevReactor/cdevEventHandler.cc
cdevEventHandler.h	: ../cdevReactor/cdevEventHandler.h
cdevHandleSet.cc	: ../cdevReactor/cdevHandleSet.cc
cdevHandleSet.h		: ../cdevReactor/cdevHandleSet.h
cdevReactor.cc		: ../cdevReactor/cdevReactor.cc
cdevReactor.h		: ../cdevReactor/cdevReactor.h
cdevSocket.cc		: ../cdevReactor/cdevSocket.cc
cdevSocket.h		: ../cdevReactor/cdevSocket.h
cdevSocketAcceptor.cc	: ../cdevReactor/cdevSocketAcceptor.cc
cdevSocketAcceptor.h	: ../cdevReactor/cdevSocketAcceptor.h
cdevSocketConnector.cc	: ../cdevReactor/cdevSocketConnector.cc
cdevSocketConnector.h	: ../cdevReactor/cdevSocketConnector.h
cdevSocketDatagram.cc	: ../cdevReactor/cdevSocketDatagram.cc
cdevSocketDatagram.h	: ../cdevReactor/cdevSocketDatagram.h
cdevSocketStream.cc	: ../cdevReactor/cdevSocketStream.cc
cdevSocketStream.h	: ../cdevReactor/cdevSocketStream.h
cdevStreamNode.cc	: ../cdevReactor/cdevStreamNode.cc
cdevStreamNode.h	: ../cdevReactor/cdevStreamNode.h
cdevStreamQueue.cc	: ../cdevReactor/cdevStreamQueue.cc
cdevStreamQueue.h	: ../cdevReactor/cdevStreamQueue.h
cdevTime.cc		: ../cdevReactor/cdevTime.cc
cdevTime.h		: ../cdevReactor/cdevTime.h
StringHash.h		: ../common/StringHash.h
