mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
improve macOS shared library building and use by calc
Dropped the use of Makefile variable ${SET_INSTALL_NAME}. Under macOS it was always needed, elsewhere it was not. Under macOS, the current version of both libcalc and libcustcalc are set to the current calc release version. Under macOS, to reduce dependency chains, we remove functions and data that are unreachable by the entry point or exported symbols. In particular, the linker is run with "-dead_strip".
This commit is contained in:
20
CHANGES
20
CHANGES
@@ -35,6 +35,8 @@ The following are the changes from calc version 2.14.3.1 to date:
|
|||||||
The calc version 2.14.3.0 is the last release that supported
|
The calc version 2.14.3.0 is the last release that supported
|
||||||
the Makefile.simple and custom/Makefile.simple files.
|
the Makefile.simple and custom/Makefile.simple files.
|
||||||
Now, a make that supports makefile conditional syntax is required.
|
Now, a make that supports makefile conditional syntax is required.
|
||||||
|
The simple target, a target that only was used for Makefile.simple
|
||||||
|
was removed.
|
||||||
|
|
||||||
Moved makefile variables that configure calc and configure how to
|
Moved makefile variables that configure calc and configure how to
|
||||||
compile calc from Makefile into a new Makefile.config file.
|
compile calc from Makefile into a new Makefile.config file.
|
||||||
@@ -47,10 +49,11 @@ The following are the changes from calc version 2.14.3.1 to date:
|
|||||||
|
|
||||||
Now, the Makefile.config file will consistently configure
|
Now, the Makefile.config file will consistently configure
|
||||||
calc and how calc is compiled and built by all calc Makefiles.
|
calc and how calc is compiled and built by all calc Makefiles.
|
||||||
|
The custom/Makefile no longer includes Makefile.
|
||||||
|
|
||||||
The platform target section from the old Makefile has been moved to
|
The platform target section from the old Makefile has been moved
|
||||||
a new file, Makefile.target. The custom/Makefile no longer includes
|
to a new file, Makefile.target. Improved the format and comments
|
||||||
Makefile.
|
in target information.
|
||||||
|
|
||||||
The Makeifle includes the Makefile.target file.
|
The Makeifle includes the Makefile.target file.
|
||||||
The cal/Makeifle includes the Makefile.target file.
|
The cal/Makeifle includes the Makefile.target file.
|
||||||
@@ -78,8 +81,15 @@ The following are the changes from calc version 2.14.3.1 to date:
|
|||||||
of the $(ALLOW_CUSTOM} Makefile variable. However when CUSTOM
|
of the $(ALLOW_CUSTOM} Makefile variable. However when CUSTOM
|
||||||
is undefined, the bulk of custom functions are not defined.
|
is undefined, the bulk of custom functions are not defined.
|
||||||
|
|
||||||
Added comments in Makefile.local for how to reduce dependency chains
|
Dropped the use of Makefile variable ${SET_INSTALL_NAME}.
|
||||||
under macOS. XXX - this doesn't yet work so don't uncomment - XXX.
|
Under macOS it was always needed, elsewhere it was not.
|
||||||
|
|
||||||
|
Under macOS, the current version of both libcalc and
|
||||||
|
libcustcalc are set to the current calc release version.
|
||||||
|
|
||||||
|
Under macOS, to reduce dependency chains, we remove functions and
|
||||||
|
data that are unreachable by the entry point or exported symbols.
|
||||||
|
In particular, the linker is run with "-dead_strip".
|
||||||
|
|
||||||
|
|
||||||
The following are the changes from calc version 2.14.2.1 to 2.14.3.0:
|
The following are the changes from calc version 2.14.2.1 to 2.14.3.0:
|
||||||
|
@@ -85,13 +85,3 @@
|
|||||||
# LDFLAGS+= -Wno-invalid-command-line-argument ${FSANITIZE} -fno-omit-frame-pointer
|
# LDFLAGS+= -Wno-invalid-command-line-argument ${FSANITIZE} -fno-omit-frame-pointer
|
||||||
# CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1
|
# CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1
|
||||||
####
|
####
|
||||||
|
|
||||||
####
|
|
||||||
# To reduce dependency chains under macOS:
|
|
||||||
#
|
|
||||||
# This comment block was tested under:
|
|
||||||
#
|
|
||||||
# macOS 13.5 with clang version 14.0.3 (clang-1403.0.22.14.1)
|
|
||||||
#
|
|
||||||
# LDFLAGS+= -Wl,-dead_strip_dylibs -Wl,-dead_strip
|
|
||||||
####
|
|
||||||
|
272
Makefile.target
272
Makefile.target
@@ -86,13 +86,18 @@
|
|||||||
#
|
#
|
||||||
# Specific target overrides or modifications to default values
|
# Specific target overrides or modifications to default values
|
||||||
|
|
||||||
|
|
||||||
################
|
################
|
||||||
# Linux target #
|
# Linux target #
|
||||||
################
|
################
|
||||||
|
|
||||||
ifeq ($(target),Linux)
|
ifeq ($(target),Linux)
|
||||||
|
|
||||||
|
# default build type for this target
|
||||||
#
|
#
|
||||||
BLD_TYPE= calc-dynamic-only
|
BLD_TYPE= calc-dynamic-only
|
||||||
|
|
||||||
|
# target specific library parameters
|
||||||
#
|
#
|
||||||
CC_SHARE= -fPIC
|
CC_SHARE= -fPIC
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
||||||
@@ -100,26 +105,15 @@ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
|
|||||||
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
||||||
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
||||||
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
||||||
|
|
||||||
|
# static library option
|
||||||
#
|
#
|
||||||
CC_STATIC=
|
CC_STATIC=
|
||||||
LD_STATIC=
|
LD_STATIC=
|
||||||
LIBCALC_STATIC=
|
LIBCALC_STATIC=
|
||||||
LIBCUSTCALC_STATIC=
|
LIBCUSTCALC_STATIC=
|
||||||
#
|
|
||||||
# If you want to add flags to all compiler and linker
|
# common values set for this target
|
||||||
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
|
||||||
# set ${COMMON_ADD}.
|
|
||||||
#
|
|
||||||
# For example to use gcc's -Werror to force warnings
|
|
||||||
# to become errors, call make with:
|
|
||||||
#
|
|
||||||
# make .. COMMON_ADD='-Werror'
|
|
||||||
#
|
|
||||||
# This facility requires a Gnu Makefile, or a make command
|
|
||||||
# that understands the += make operand.
|
|
||||||
#
|
|
||||||
COMMON_CFLAGS+= ${COMMON_ADD}
|
|
||||||
COMMON_LDFLAGS+= ${COMMON_ADD}
|
|
||||||
#
|
#
|
||||||
#CCWARN= -Wall
|
#CCWARN= -Wall
|
||||||
CCWARN= -Wall -Wextra -pedantic
|
CCWARN= -Wall -Wextra -pedantic
|
||||||
@@ -129,69 +123,65 @@ WNO_LONG_LONG= -Wno-long-long
|
|||||||
CCWERR=
|
CCWERR=
|
||||||
CCOPT= ${DEBUG}
|
CCOPT= ${DEBUG}
|
||||||
CCMISC=
|
CCMISC=
|
||||||
#
|
|
||||||
LCC= gcc
|
LCC= gcc
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
#
|
|
||||||
endif # ($(target),Linux)
|
endif # ($(target),Linux)
|
||||||
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Apple macOS / Darwin target #
|
# Apple macOS / Darwin target #
|
||||||
###############################
|
###############################
|
||||||
|
|
||||||
|
ifeq ($(target),Darwin)
|
||||||
|
|
||||||
|
# default build type for this target
|
||||||
|
#
|
||||||
|
BLD_TYPE= calc-dynamic-only
|
||||||
|
|
||||||
# For old Apple Power PC systems, we need to add:
|
# For old Apple Power PC systems, we need to add:
|
||||||
#
|
#
|
||||||
# -std=gnu99 -arch ppc
|
# -std=gnu99 -arch ppc
|
||||||
#
|
#
|
||||||
ifeq ($(arch),powerpc)
|
ifeq ($(arch),powerpc)
|
||||||
COMMON_CFLAGS+= -std=gnu99
|
COMMON_ADD+= -std=gnu99
|
||||||
COMMON_LDFLAGS+= -std=gnu99
|
|
||||||
ARCH_CFLAGS+= -arch ppc
|
ARCH_CFLAGS+= -arch ppc
|
||||||
endif # ($(arch),powerpc)
|
endif # ($(arch),powerpc)
|
||||||
|
|
||||||
ifeq ($(target),Darwin)
|
# target specific library parameters
|
||||||
#
|
|
||||||
BLD_TYPE= calc-dynamic-only
|
|
||||||
#
|
#
|
||||||
CC_SHARE= -fPIC
|
CC_SHARE= -fPIC
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:${PREFIX}/lib
|
DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:${PREFIX}/lib
|
||||||
LD_SHARE= ${ARCH_CFLAGS}
|
LD_SHARE= ${ARCH_CFLAGS}
|
||||||
#SET_INSTALL_NAME= no
|
LIBCALC_SHLIB= -dynamiclib -undefined dynamic_lookup \
|
||||||
SET_INSTALL_NAME= yes
|
-install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} \
|
||||||
ifeq ($(SET_INSTALL_NAME),yes)
|
-current_version ${VERSION} \
|
||||||
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
|
||||||
-install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} ${ARCH_CFLAGS}
|
|
||||||
else # ($(SET_INSTALL_NAME),yes)
|
|
||||||
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
|
||||||
${ARCH_CFLAGS}
|
${ARCH_CFLAGS}
|
||||||
endif # ($(SET_INSTALL_NAME),yes)
|
LIBCUSTCALC_SHLIB= -dynamiclib -undefined dynamic_lookup \
|
||||||
ifeq ($(SET_INSTALL_NAME),yes)
|
-install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} \
|
||||||
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
-current_version ${VERSION} \
|
||||||
-install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${ARCH_CFLAGS}
|
|
||||||
else # ($(SET_INSTALL_NAME),yes)
|
|
||||||
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
|
||||||
${ARCH_CFLAGS}
|
${ARCH_CFLAGS}
|
||||||
endif # ($(SET_INSTALL_NAME),yes)
|
|
||||||
|
# To reduce dependency chains under macOS, we remove functions and
|
||||||
|
# data that are unreachable by the entry point or exported symbols.
|
||||||
|
#
|
||||||
|
LDFLAGS+= -Wl,-dead_strip
|
||||||
|
|
||||||
|
# NOTE: Do not use: LDFLAGS+= -Wl,-dead_strip_dylibs
|
||||||
|
#
|
||||||
|
# This option should not be used when linking against a dylib which is
|
||||||
|
# required at runtime for some indirect reason such as the dylib has an
|
||||||
|
# important initializer. The libcalc and libcustcalc have
|
||||||
|
# important initializers, and so this option should not be used.
|
||||||
|
|
||||||
|
# static library option
|
||||||
#
|
#
|
||||||
CC_STATIC=
|
CC_STATIC=
|
||||||
LD_STATIC= ${ARCH_CFLAGS}
|
LD_STATIC= ${ARCH_CFLAGS}
|
||||||
LIBCALC_STATIC=
|
LIBCALC_STATIC=
|
||||||
LIBCUSTCALC_STATIC=
|
LIBCUSTCALC_STATIC=
|
||||||
# If you want to add flags to all compiler and linker
|
|
||||||
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
# common values set for this target
|
||||||
# set ${COMMON_ADD}.
|
|
||||||
#
|
|
||||||
# For example to use clang's -fsanitize for calc testing,
|
|
||||||
# which requires a common set of flags to be passed to
|
|
||||||
# every compile and link, then call make with:
|
|
||||||
#
|
|
||||||
# make .. COMMON_ADD='-fsanitize=undefined -fsanitize=address'
|
|
||||||
#
|
|
||||||
# This facility requires a Gnu Makefile, or a make command
|
|
||||||
# that understands the += make operand.
|
|
||||||
#
|
|
||||||
COMMON_CFLAGS+= ${COMMON_ADD}
|
|
||||||
COMMON_LDFLAGS+= ${COMMON_ADD}
|
|
||||||
#
|
#
|
||||||
#CCWARN= -Wall
|
#CCWARN= -Wall
|
||||||
CCWARN= -Wall -Wextra -pedantic
|
CCWARN= -Wall -Wextra -pedantic
|
||||||
@@ -201,24 +191,32 @@ WNO_LONG_LONG= -Wno-long-long
|
|||||||
CCWERR=
|
CCWERR=
|
||||||
CCOPT= ${DEBUG}
|
CCOPT= ${DEBUG}
|
||||||
CCMISC= ${ARCH_CFLAGS}
|
CCMISC= ${ARCH_CFLAGS}
|
||||||
#
|
|
||||||
LCC= cc
|
LCC= cc
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
#
|
|
||||||
# Darwin dynamic shared lib filenames
|
# Darwin dynamic shared lib filenames
|
||||||
|
#
|
||||||
LIB_EXT:= .dylib
|
LIB_EXT:= .dylib
|
||||||
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
||||||
|
|
||||||
# LDCONFIG not required on this platform, so we redefine it to an empty string
|
# LDCONFIG not required on this platform, so we redefine it to an empty string
|
||||||
|
#
|
||||||
LDCONFIG:=
|
LDCONFIG:=
|
||||||
|
|
||||||
endif # ($(target),Darwin)
|
endif # ($(target),Darwin)
|
||||||
|
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# FreeBSD target #
|
# FreeBSD target #
|
||||||
##################
|
##################
|
||||||
|
|
||||||
ifeq ($(target),FreeBSD)
|
ifeq ($(target),FreeBSD)
|
||||||
|
|
||||||
|
# default build type for this target
|
||||||
#
|
#
|
||||||
BLD_TYPE= calc-dynamic-only
|
BLD_TYPE= calc-dynamic-only
|
||||||
|
|
||||||
|
# target specific library parameters
|
||||||
#
|
#
|
||||||
CC_SHARE= -fPIC
|
CC_SHARE= -fPIC
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
||||||
@@ -226,26 +224,13 @@ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
|
|||||||
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
||||||
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
||||||
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
||||||
#
|
|
||||||
CC_STATIC=
|
CC_STATIC=
|
||||||
LD_STATIC=
|
LD_STATIC=
|
||||||
LIBCALC_STATIC=
|
LIBCALC_STATIC=
|
||||||
LIBCUSTCALC_STATIC=
|
LIBCUSTCALC_STATIC=
|
||||||
#
|
|
||||||
# If you want to add flags to all compiler and linker
|
# common values set for this target
|
||||||
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
|
||||||
# set ${COMMON_ADD}.
|
|
||||||
#
|
|
||||||
# For example to use gcc's -Werror to force warnings
|
|
||||||
# to become errors, call make with:
|
|
||||||
#
|
|
||||||
# make .. COMMON_ADD='-Werror'
|
|
||||||
#
|
|
||||||
# This facility requires a Gnu Makefile, or a make command
|
|
||||||
# that understands the += make operand.
|
|
||||||
#
|
|
||||||
COMMON_CFLAGS+= ${COMMON_ADD}
|
|
||||||
COMMON_LDFLAGS+= ${COMMON_ADD}
|
|
||||||
#
|
#
|
||||||
#CCWARN= -Wall
|
#CCWARN= -Wall
|
||||||
CCWARN= -Wall -Wextra -pedantic
|
CCWARN= -Wall -Wextra -pedantic
|
||||||
@@ -255,21 +240,28 @@ WNO_LONG_LONG= -Wno-long-long
|
|||||||
CCWERR=
|
CCWERR=
|
||||||
CCOPT= ${DEBUG}
|
CCOPT= ${DEBUG}
|
||||||
CCMISC=
|
CCMISC=
|
||||||
#
|
|
||||||
LCC= gcc
|
LCC= gcc
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
|
|
||||||
|
# We must use gmake as the FreeBSD target because under some older
|
||||||
|
# releases of FreeBSD, make not support conditional syntax.
|
||||||
#
|
#
|
||||||
MAKE= gmake
|
MAKE= gmake
|
||||||
#
|
|
||||||
endif # ($(target),FreeBSD)
|
endif # ($(target),FreeBSD)
|
||||||
|
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# OpenBSD target #
|
# OpenBSD target #
|
||||||
##################
|
##################
|
||||||
|
|
||||||
ifeq ($(target),OpenBSD)
|
ifeq ($(target),OpenBSD)
|
||||||
|
|
||||||
|
# default build type for this target
|
||||||
#
|
#
|
||||||
BLD_TYPE= calc-dynamic-only
|
BLD_TYPE= calc-dynamic-only
|
||||||
|
|
||||||
|
# default build type for this target
|
||||||
#
|
#
|
||||||
CC_SHARE= -fPIC
|
CC_SHARE= -fPIC
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
||||||
@@ -277,26 +269,15 @@ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
|
|||||||
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
||||||
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
||||||
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
||||||
|
|
||||||
|
# static library option
|
||||||
#
|
#
|
||||||
CC_STATIC=
|
CC_STATIC=
|
||||||
LD_STATIC=
|
LD_STATIC=
|
||||||
LIBCALC_STATIC=
|
LIBCALC_STATIC=
|
||||||
LIBCUSTCALC_STATIC=
|
LIBCUSTCALC_STATIC=
|
||||||
#
|
|
||||||
# If you want to add flags to all compiler and linker
|
# common values set for this target
|
||||||
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
|
||||||
# set ${COMMON_ADD}.
|
|
||||||
#
|
|
||||||
# For example to use gcc's -Werror to force warnings
|
|
||||||
# to become errors, call make with:
|
|
||||||
#
|
|
||||||
# make .. COMMON_ADD='-Werror'
|
|
||||||
#
|
|
||||||
# This facility requires a Gnu Makefile, or a make command
|
|
||||||
# that understands the += make operand.
|
|
||||||
#
|
|
||||||
COMMON_CFLAGS+= ${COMMON_ADD}
|
|
||||||
COMMON_LDFLAGS+= ${COMMON_ADD}
|
|
||||||
#
|
#
|
||||||
#CCWARN= -Wall
|
#CCWARN= -Wall
|
||||||
CCWARN= -Wall -Wextra -pedantic
|
CCWARN= -Wall -Wextra -pedantic
|
||||||
@@ -314,13 +295,16 @@ MAKE= gmake
|
|||||||
#
|
#
|
||||||
endif # ($(target),OpenBSD)
|
endif # ($(target),OpenBSD)
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# Cygwin target #
|
# Cygwin target #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
ifeq ($(target),Cygwin)
|
ifeq ($(target),Cygwin)
|
||||||
#
|
|
||||||
BLD_TYPE= calc-static-only
|
BLD_TYPE= calc-static-only
|
||||||
|
|
||||||
|
# target specific library parameters
|
||||||
#
|
#
|
||||||
CC_SHARE= -fPIC
|
CC_SHARE= -fPIC
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
||||||
@@ -328,26 +312,15 @@ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
|
|||||||
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
||||||
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
||||||
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
||||||
|
|
||||||
|
# static library option
|
||||||
#
|
#
|
||||||
CC_STATIC=
|
CC_STATIC=
|
||||||
LIBCALC_STATIC=
|
LIBCALC_STATIC=
|
||||||
LIBCUSTCALC_STATIC=
|
LIBCUSTCALC_STATIC=
|
||||||
LD_STATIC=
|
LD_STATIC=
|
||||||
#
|
|
||||||
# If you want to add flags to all compiler and linker
|
# common values set for this target
|
||||||
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
|
||||||
# set ${COMMON_ADD}.
|
|
||||||
#
|
|
||||||
# For example to use gcc's -Werror to force warnings
|
|
||||||
# to become errors, call make with:
|
|
||||||
#
|
|
||||||
# make .. COMMON_ADD='-Werror'
|
|
||||||
#
|
|
||||||
# This facility requires a Gnu Makefile, or a make command
|
|
||||||
# that understands the += make operand.
|
|
||||||
#
|
|
||||||
COMMON_CFLAGS+= ${COMMON_ADD}
|
|
||||||
COMMON_LDFLAGS+= ${COMMON_ADD}
|
|
||||||
#
|
#
|
||||||
#CCWARN= -Wall
|
#CCWARN= -Wall
|
||||||
CCWARN= -Wall -Wextra -pedantic
|
CCWARN= -Wall -Wextra -pedantic
|
||||||
@@ -357,61 +330,11 @@ WNO_LONG_LONG= -Wno-long-long
|
|||||||
CCWERR=
|
CCWERR=
|
||||||
CCOPT= ${DEBUG}
|
CCOPT= ${DEBUG}
|
||||||
CCMISC=
|
CCMISC=
|
||||||
#
|
|
||||||
LCC= cc
|
LCC= cc
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
#
|
|
||||||
endif # ($(target),Cygwin)
|
endif # ($(target),Cygwin)
|
||||||
|
|
||||||
#################
|
|
||||||
# simple target #
|
|
||||||
#################
|
|
||||||
|
|
||||||
# NOTE: This is not a real host target. It is just a best
|
|
||||||
# attempt is a generic host not otherwise found above.
|
|
||||||
|
|
||||||
ifeq ($(target),simple)
|
|
||||||
#
|
|
||||||
BLD_TYPE= calc-static-only
|
|
||||||
#
|
|
||||||
CC_SHARE= -fPIC
|
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
|
||||||
LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
|
|
||||||
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
|
||||||
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
|
||||||
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
|
||||||
#
|
|
||||||
CC_STATIC=
|
|
||||||
LD_STATIC=
|
|
||||||
LIBCALC_STATIC=
|
|
||||||
LIBCUSTCALC_STATIC=
|
|
||||||
#
|
|
||||||
#CCWARN= -Wall
|
|
||||||
CCWARN= -Wall -Wextra -pedantic
|
|
||||||
WNO_IMPLICT= -Wno-implicit
|
|
||||||
WNO_ERROR_LONG_LONG= -Wno-error=long-long
|
|
||||||
WNO_LONG_LONG= -Wno-long-long
|
|
||||||
CCWERR=
|
|
||||||
CCOPT= ${DEBUG}
|
|
||||||
CCMISC=
|
|
||||||
#
|
|
||||||
LCC= cc
|
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
|
||||||
#
|
|
||||||
# The simple makefile forces the use of static ${CC} flags
|
|
||||||
#
|
|
||||||
# ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
|
|
||||||
# CFLAGS are given to ${CC} for calc programs other than intermediate programs
|
|
||||||
# ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
|
|
||||||
# LDFLAGS for ${CC} in linking calc programs other than intermediate programs
|
|
||||||
#
|
|
||||||
ICFLAGS= ${COMMON_CFLAGS} ${CCBAN} ${CC_STATIC}
|
|
||||||
CFLAGS= ${ICFLAGS} ${CCOPT}
|
|
||||||
#
|
|
||||||
ILDFLAGS= ${COMMON_LDFLAGS} ${LD_STATIC}
|
|
||||||
LDFLAGS= ${LD_DEBUG} ${ILDFLAGS} ${LIBCALC_STATIC} ${LIBCUSTCALC_STATIC}
|
|
||||||
#
|
|
||||||
endif # ($(target),simple)
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# default target - (when target is empty) #
|
# default target - (when target is empty) #
|
||||||
@@ -421,8 +344,12 @@ endif # ($(target),simple)
|
|||||||
# host target matches.
|
# host target matches.
|
||||||
|
|
||||||
ifeq ($(target),)
|
ifeq ($(target),)
|
||||||
|
|
||||||
|
# default build type for this target
|
||||||
#
|
#
|
||||||
BLD_TYPE= calc-static-only
|
BLD_TYPE= calc-static-only
|
||||||
|
|
||||||
|
# target specific library parameters
|
||||||
#
|
#
|
||||||
CC_SHARE= -fPIC
|
CC_SHARE= -fPIC
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
|
||||||
@@ -430,12 +357,34 @@ LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
|
|||||||
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
"-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
|
||||||
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
|
||||||
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
|
||||||
|
|
||||||
|
# static library option
|
||||||
#
|
#
|
||||||
CC_STATIC=
|
CC_STATIC=
|
||||||
LIBCALC_STATIC=
|
LIBCALC_STATIC=
|
||||||
LIBCUSTCALC_STATIC=
|
LIBCUSTCALC_STATIC=
|
||||||
LD_STATIC=
|
LD_STATIC=
|
||||||
|
|
||||||
|
# common values set for this target
|
||||||
#
|
#
|
||||||
|
#CCWARN= -Wall
|
||||||
|
CCWARN= -Wall -Wextra -pedantic
|
||||||
|
WNO_IMPLICT= -Wno-implicit
|
||||||
|
WNO_ERROR_LONG_LONG= -Wno-error=long-long
|
||||||
|
WNO_LONG_LONG= -Wno-long-long
|
||||||
|
CCWERR=
|
||||||
|
CCOPT= ${DEBUG}
|
||||||
|
CCMISC=
|
||||||
|
LCC= gcc
|
||||||
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
|
|
||||||
|
endif # ($(target),)
|
||||||
|
|
||||||
|
|
||||||
|
###########################################
|
||||||
|
# Set the default compile flags for ${CC} #
|
||||||
|
###########################################
|
||||||
|
|
||||||
# If you want to add flags to all compiler and linker
|
# If you want to add flags to all compiler and linker
|
||||||
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
||||||
# set ${COMMON_ADD}.
|
# set ${COMMON_ADD}.
|
||||||
@@ -450,23 +399,6 @@ LD_STATIC=
|
|||||||
#
|
#
|
||||||
COMMON_CFLAGS+= ${COMMON_ADD}
|
COMMON_CFLAGS+= ${COMMON_ADD}
|
||||||
COMMON_LDFLAGS+= ${COMMON_ADD}
|
COMMON_LDFLAGS+= ${COMMON_ADD}
|
||||||
#
|
|
||||||
#CCWARN= -Wall
|
|
||||||
CCWARN= -Wall -Wextra -pedantic
|
|
||||||
WNO_IMPLICT= -Wno-implicit
|
|
||||||
WNO_ERROR_LONG_LONG= -Wno-error=long-long
|
|
||||||
WNO_LONG_LONG= -Wno-long-long
|
|
||||||
CCWERR=
|
|
||||||
CCOPT= ${DEBUG}
|
|
||||||
CCMISC=
|
|
||||||
#
|
|
||||||
LCC= gcc
|
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
|
||||||
endif # ($(target),)
|
|
||||||
|
|
||||||
###########################################
|
|
||||||
# Set the default compile flags for ${CC} #
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# Required flags to compile C files for calc
|
# Required flags to compile C files for calc
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user