# ******************************************************************************
# * Makefile.hpux-cl: This is the platform specific Makefile for HPUX using
# *                   the CenterLine C++ compiler.
# *
# * Externals       : This Makefile relies on the developer defining the 
# *                   following external definitions...
# *
# *                   CDEV      : The base directory of the CDEV distribution
# ******************************************************************************
TARGET          = hpux-cl
SHOBJ           = NO
OS_MAJOR       := $(shell uname -r | awk -F "." '{print $$2; exit}')
OS_MAJOR_NUM   := $(shell awk 'BEGIN {VAL=$(OS_MAJOR); print VAL; exit; }')
OS_MINOR       := $(shell uname -r | awk -F "." '{print $$3; exit}')
OS_MINOR_NUM   := $(shell awk 'BEGIN {VAL=$(OS_MINOR); print VAL; exit; }')
OS_VERSION_DEF := -D_OS_MAJOR_=$(OS_MAJOR_NUM) -D_OS_MINOR_=$(OS_MINOR_NUM)

include $(CDEV)/include/makeinclude/Makefile.common
include $(CDEV)/include/makeinclude/Makefile.archive

ifeq ($(OS_MAJOR_NUM), 10)
	HP_FLAGS = -Dvolatile=""
endif

# ******************************************************************************
# * Platform specific compile and link options.
# ******************************************************************************

# ******************************************************************************
# * Only define the DEBUGFLAG if DEBUG has been specified by the caller.
# ******************************************************************************
ifdef DEBUG
DEBUGFLAG     = -g
endif

CXX           = /usr/csite4/CenterLine/bin/CC
CXXFLAGS      = -z -pta -D__CENTERLINE__ $(CXXEXTRA) $(CXXINCLUDES) $(CDEVINCLUDES) \
                $(OS_VERSION_DEF) $(DEBUGFLAG) $(HP_FLAGS)
PIC           = 
OSLIBS        = -lm


# ******************************************************************************
# * These definitions define the names and locations of libraries that are
# * required by CDEV for a shared and archive applications.  The developer
# * is required to add the list of service specific libraries.
# ******************************************************************************
ifeq ($(SHOBJ), NO)
  CDEVLIBS    = $(CDEVLIB)/libcdev.a $(ARCHIVELIBS)
else
  CDEVLIBS    = -L$(CDEVLIB) -lcdev
endif


# ******************************************************************************
# * Platform specific compile and link macros.
# ******************************************************************************
COMPILE.cc    = $(CXX) -c $(CXXFLAGS) $^ -o $@
COMPILE.cc.so = echo "Shared Object Compilation is NOT Supported by CenterLine"
LINK.cc       = rm -rf $@; echo "=> $(CXX) -o $(@F) $(^F)";$(PROOF) $(CXX) $(CXXFLAGS) $(CXXEXTRA) $^ -o $@ $(CDEVLIBS) $(OSLIBS)
