Files
2022-12-13 12:44:04 +01:00

94 lines
3.7 KiB
Makefile
Executable File

# ******************************************************************************
# * Makefile.solaris : This is the platform specific Makefile for solaris.
# *
# * Externals : This Makefile relies on the developer defining the
# * following external definitions...
# *
# * CDEV : The base directory of the CDEV distribution
# ******************************************************************************
TARGET = solaris
include $(CDEV)/extensions/cdevGenericServer/include/makeinclude/Makefile.common
include $(CDEV)/include/makeinclude/Makefile.archive
# ******************************************************************************
# * Platform specific compile and link options.
# ******************************************************************************
# ******************************************************************************
# * Only specify the DEBUGFLAG if the DEBUG variable has been set.
# ******************************************************************************
ifdef DEBUG
DEBUGFLAG = -g
endif
CXX = CC
CC = cc
CXXFLAGS = -Dsolaris $(DEBUGFLAG) $(CXXEXTRA) $(CXXINCLUDES) \
$(CDEVINCLUDES) $(BASEINCLUDES) -DSYSV
CFLAGS = -Dsolaris $(DEBUGFLAG) $(CEXTRA) $(CXXINCLUDES) $(CDEVINCLUDES) $(BASEINCLUDES) -DSYSV
AR = $(CXX)
ARFLAGS = -xar -o
RANLIB = ranlib
DLD = $(CXX)
SOFLAGS = -G $(CXXFLAGS)
PIC = -Kpic
SHARED_EXT = so
NETLIBS = -lsocket -lnsl -ldl -lgen
OSLIBS = $(NETLIBS) -ll -ly -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 = $(QUIET)$(CXX_CMD_ECHO)rm -rf $@;\
mkdir -p $(@D);\
$(CXX) -c $(CXXFLAGS) $^ -o $@
COMPILE.cc.so = $(QUIET)$(CXX_CMD_ECHO)rm -rf $@;\
mkdir -p $(@D);\
$(CXX) $(CXXFLAGS) $(PIC) -c -o $@ $^;\
$(CXX) $(CXXFLAGS) -G -o $(@D)/$(*F).so -h $(@D)/$(*F).so \
-R $(CDEVLIB) -L$(CDEVLIB) -L./ $@
COMPILE.c = $(QUIET)$(CC_CMD_ECHO)rm -rf $@;\
mkdir -p $(@D);\
$(CC) -c $(CFLAGS) $^ -o $@
COMPILE.c.so = $(QUIET)$(CC_CMD_ECHO)rm -rf $@;\
mkdir -p $(@D);\
$(CC) -c $(CFLAGS) $(PIC) $^ -o $@
LINK.cc = $(QUIET)$(CXX_CMD_ECHO)rm -rf $@;\
mkdir -p $(@D);\
$(CXX) $(CXXFLAGS)
LINK.a = $(QUIET)$(AR_CMD_ECHO)rm -rf $@;\
mkdir -p $(@D);\
$(AR) $(ARFLAGS)
LINK.so = $(QUIET)$(SO_CMD_ECHO)rm -rf $@;\
mkdir -p $(@D);\
$(DLD) $(SOFLAGS)
# ******************************************************************************
# * This is the macro to build a shared object/library.... it requires the
# * following variables to be defined...
# *
# * SO_SRCS : Names of the component source files
# * SO_LIBS : Names of the dependent libraries
# * LIBS : All libraries necessary to compile the dummy application
# ******************************************************************************
SOBUILD = rm -f $@;\
mkdir -p $(@D);\
echo "=> Building shared object $(@F)";\
$(LINK.so) -o $@ $^ -R $(CDEVLIB) -L$(CDEVLIB) -L./ $(NETLIBS)