Files
cdev-1.7.2n/include/makeinclude/Makefile.hpux
2022-12-13 12:44:04 +01:00

75 lines
3.1 KiB
Makefile

# ******************************************************************************
# * Makefile.hpux : This is the platform specific Makefile for HPUX.
# *
# * Externals : This Makefile relies on the developer defining the
# * following external definitions...
# *
# * CDEV : The base directory of the CDEV distribution
# ******************************************************************************
TARGET = hpux
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
# ******************************************************************************
# * 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
HPCXX_FLAGS := -Aa -pta -ptb
HPCXX_SHLIB_PATH := -Wl,+s
else
CXX := /opt/aCC/bin/aCC
HPCXX_FLAGS := +W302,392,469,495,655,829
HPCXX_SHLIB_PATH := -Wl,+s
ifeq ($(OS_MAJOR).$(OS_MINOR), 10.10)
HP_FLAGS = -Dvolatile=""
endif
endif
# ******************************************************************************
# * Platform specific compile and link options.
# ******************************************************************************
# ******************************************************************************
# * Only define the DEBUGFLAG if DEBUG has been specified by the caller.
# ******************************************************************************
ifdef DEBUG
DEBUGFLAG = -g
else
DEBUGFLAG = +O2
endif
CXXFLAGS = -z $(HPCXX_FLAGS) $(CXXEXTRA) $(CXXINCLUDES) $(CDEVINCLUDES) \
$(OS_VERSION_DEF) $(DEBUGFLAG) $(HP_FLAGS)
PIC = +z
OSLIBS = -L/lib -lm
# ******************************************************************************
# * These definitions define the names and locations of libraries that are
# * required by CDEV for a shared and archive applications.
# ******************************************************************************
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 = $(CXX) -c $(CXXFLAGS) $(PIC) $^ -o $@
LINK.cc = rm -rf $@; echo "=> $(CXX) -o $(@F) $(^F)";$(CXX) $(CXXFLAGS) $(HPCXX_SHLIB_PATH) $(CXXEXTRA) $^ -o $@ $(CDEVLIBS) $(OSLIBS)