mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Added COMMON_ADD Makefile facility
Added the makefile variable ${COMMON_ADD} that will add flags to all compile and link commands. The ${COMMON_ADD} flags are appended to both ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}. This facility is available to nearly all platforms except those with very old make comamnds that do not understand the += operator. Example on masOS (Darwin), one may invoke clang's -fsanitize facility by: make clobber all COMMON_ADD='-fsanitize=undefined -fsanitize=address' Another example. To force C warnings to be treated as errors: make COMMON_ADD='-Werror'
This commit is contained in:
11
Makefile
11
Makefile
@@ -119,6 +119,16 @@ RPM_TOP= ${HOME}/rpm/calc
|
||||
|
||||
CCWERR= -Werror -Wextra -pedantic
|
||||
|
||||
#################################
|
||||
# clang -fsanitize test options #
|
||||
#################################
|
||||
|
||||
ifeq ($(target),Darwin)
|
||||
COMMON_ADD= -fsanitize=undefined -fsanitize=address
|
||||
else
|
||||
COMMON_ADD=
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
#-=-=-=-=-=-=-=-=- Be careful if you change something below -=-=-=-=-=-=-=-=-#
|
||||
##############################################################################
|
||||
@@ -173,6 +183,7 @@ XVAR= \
|
||||
DARWIN_ARCH='${DARWIN_ARCH}' \
|
||||
CCWERR='${CCWERR}' \
|
||||
NROFF='${NROFF}' \
|
||||
COMMON_ADD='${COMMON_ADD}' \
|
||||
Q='${Q}' \
|
||||
V='${V}'
|
||||
|
||||
|
Reference in New Issue
Block a user