95 lines
3.6 KiB
Makefile
95 lines
3.6 KiB
Makefile
# ******************************************************************************
|
|
# * Makefile.Linux : This is the platform specific Makefile for Linux.
|
|
# *
|
|
# * Externals : This Makefile relies on the developer defining the
|
|
# * following external definitions...
|
|
# *
|
|
# * CDEV : The base directory of the CDEV distribution
|
|
# ******************************************************************************
|
|
TARGET = Linux
|
|
|
|
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
|
|
else
|
|
DEBUGFLAG = -O2
|
|
endif
|
|
|
|
CXX = g++
|
|
CC = gcc
|
|
CXXFLAGS = -DLinux -fno-for-scope $(DEBUGFLAG) $(CXXEXTRA) $(CXXINCLUDES) \
|
|
$(CDEVINCLUDES) $(BASEINCLUDES)
|
|
CFLAGS = -DLinux $(DEBUGFLAG) $(CEXTRA) $(CXXINCLUDES) $(CDEVINCLUDES) $(BASEINCLUDES)
|
|
AR = ar
|
|
ARFLAGS = ruv
|
|
RANLIB = ranlib
|
|
DLD = $(CXX)
|
|
SOFLAGS = -shared
|
|
PIC = -fpic
|
|
SHARED_EXT = so
|
|
NETLIBS =
|
|
OSLIBS = $(NETLIBS) -lm -ldl
|
|
|
|
|
|
# ******************************************************************************
|
|
# * 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 $@ $^
|
|
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)$(LINK_CMD_ECHO)rm -rf $@;\
|
|
mkdir -p $(@D);\
|
|
$(CXX) $(CXXFLAGS)
|
|
#$(CXX) $(CXXFLAGS) -Xlinker -rpath -Xlinker $(BASELIB) -Xlinker -rpath -Xlinker $(CDEVLIB)
|
|
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)
|
|
|
|
|