mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
make: Replace BUILD_XXX make flag variables by FINAL_XXX
The following BUILD_XXX variables are renamed to their respective FINAL_XXX counterparts, as that name is more expressive: BUILD_CFLAGS, BUILD_CPPFLAGS, BUILD_CXXFLAGS, BUILD_EXTRA_DEBUG_FLAGS, BUILD_INCLUDE, BUILD_LDFLAGS, BUILD_LIBFLAGS, BUILD_LPPFLAGS Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
e0486a936e
commit
3365aa3db6
18 changed files with 249 additions and 249 deletions
356
make/defs-cpp.mk
356
make/defs-cpp.mk
|
|
@ -31,7 +31,7 @@ TAGGED_TMPL_MAKEFILES = $(wildcard $(addsuffix .mk,$(foreach t,$(TAGGED_T
|
|||
ifneq ($(findstring st-nucleo-f103rb,$(TAGGED_TMPL_TAGS)),)
|
||||
TAGGED_TMPL_TAGS += cortex-m3
|
||||
MCU_BOARD_MODEL ?= ST-NUCLEO-F103RB
|
||||
BUILD_CPPFLAGS += -DST_NUCLEO_F103RB
|
||||
FINAL_CPPFLAGS += -DST_NUCLEO_F103RB
|
||||
MCU_FLASH_OFFSET ?= 0x0000000
|
||||
MCU_FLASH_SIZE ?= 0x5000
|
||||
MCU_MEM_FETCH_OFFSET ?= 0x08000000
|
||||
|
|
@ -50,7 +50,7 @@ ifneq ($(findstring st-nucleo-f103rb,$(TAGGED_TMPL_TAGS)),)
|
|||
else ifneq ($(findstring st-disc1-f429i,$(TAGGED_TMPL_TAGS)),)
|
||||
TAGGED_TMPL_TAGS += cortex-m4
|
||||
MCU_BOARD_MODEL ?= ST-DISC1-F429I
|
||||
BUILD_CPPFLAGS += -DST_DISC1_F429I
|
||||
FINAL_CPPFLAGS += -DST_DISC1_F429I
|
||||
#MCU_OPENOCD_CFG_NAME ?= openocd-st-stm32f429disc1.cfg
|
||||
MCU_OPENOCD_CFG_NAME ?= openocd-st-stm32f429discovery.cfg
|
||||
MCU_FLASH_BANK_NAME ?= internal
|
||||
|
|
@ -83,7 +83,7 @@ else ifneq ($(findstring st-disc1-f429i,$(TAGGED_TMPL_TAGS)),)
|
|||
else ifneq ($(findstring st-disco-f769i,$(TAGGED_TMPL_TAGS)),)
|
||||
TAGGED_TMPL_TAGS += cortex-m7
|
||||
MCU_BOARD_MODEL ?= ST-DISCO-F769I
|
||||
BUILD_CPPFLAGS += -DST_DISCO_F769I
|
||||
FINAL_CPPFLAGS += -DST_DISCO_F769I
|
||||
ifneq ($(findstring j-link,$(TAGGED_TMPL_TAGS)),)
|
||||
MCU_OPENOCD_CFG_NAME ?= openocd-stmqspi-st-stm32f769i-disco-jlink.cfg
|
||||
else
|
||||
|
|
@ -154,20 +154,20 @@ ifneq ($(TARGET_TRIPLET),$(HOST_TRIPLET)) # we're cross-compiling
|
|||
TC_BIN_PREFIX ?= $(CROSS_TOOL_DIR)/bin/i686-pc-mingw32-
|
||||
endif
|
||||
|
||||
BUILD_CPPFLAGS += -D_WINDOWS
|
||||
BUILD_LDFLAGS += -lws2_32
|
||||
FINAL_CPPFLAGS += -D_WINDOWS
|
||||
FINAL_LDFLAGS += -lws2_32
|
||||
WINDRES ?= $(TC_BIN_PREFIX)windres
|
||||
USE_GFILTER ?= false
|
||||
MS_LD ?= wine $(HOME)/local/mingw/packages/msvcpp/bin/LIB.EXE
|
||||
endif
|
||||
|
||||
#BUILD_CPPFLAGS += -I$(TC_SYS_ROOT)/include
|
||||
#BUILD_LDFLAGS += -L$(TC_SYS_ROOT)/lib
|
||||
#FINAL_CPPFLAGS += -I$(TC_SYS_ROOT)/include
|
||||
#FINAL_LDFLAGS += -L$(TC_SYS_ROOT)/lib
|
||||
|
||||
else # we're not cross-compiling
|
||||
|
||||
TC_SYS_ROOT ?= /usr
|
||||
BUILD_LIBFLAGS += -pthread
|
||||
FINAL_LIBFLAGS += -pthread
|
||||
|
||||
endif
|
||||
|
||||
|
|
@ -205,8 +205,8 @@ ifeq ($(COMPILER_SUITE),gcc)
|
|||
CXX ?= $(GXX)
|
||||
LD ?= $(GXX)
|
||||
|
||||
BUILD_CXXFLAGS += -std=c++$(CPP_STANDARD_VERSION)
|
||||
BUILD_CFLAGS += -std=gnu$(C_STANDARD_VERSION)
|
||||
FINAL_CXXFLAGS += -std=c++$(CPP_STANDARD_VERSION)
|
||||
FINAL_CFLAGS += -std=gnu$(C_STANDARD_VERSION)
|
||||
|
||||
ifeq ($(shell $(TEST) $(GCC_MAJOR) -ge 5; $(ECHO) $$?),0)
|
||||
ifeq ($(USE_CPP_FORCE_OVERRIDE),true)
|
||||
|
|
@ -244,106 +244,106 @@ endif
|
|||
|
||||
ifeq ($(COMPILER_SUITE),gcc)
|
||||
DEBUGGER ?= gdb
|
||||
BUILD_EXTRA_DEBUG_FLAGS += -ggdb
|
||||
FINAL_EXTRA_DEBUG_FLAGS += -ggdb
|
||||
else ifeq ($(COMPILER_SUITE),clang)
|
||||
DEBUGGER = lldb
|
||||
endif
|
||||
|
||||
# -- gather compiler options in BUILD_XXXFLAGS
|
||||
|
||||
BUILD_CFLAGS += $(CFLAGS)
|
||||
BUILD_CXXFLAGS += $(CXXFLAGS)
|
||||
BUILD_CPPFLAGS += $(CPPFLAGS)
|
||||
BUILD_LDFLAGS += $(LDFLAGS)
|
||||
FINAL_CFLAGS += $(CFLAGS)
|
||||
FINAL_CXXFLAGS += $(CXXFLAGS)
|
||||
FINAL_CPPFLAGS += $(CPPFLAGS)
|
||||
FINAL_LDFLAGS += $(LDFLAGS)
|
||||
|
||||
BUILD_CPPFLAGS += -D_FILE_OFFSET_BITS=64 -Wall -Wno-unused-value -Wno-deprecated -DPROJECT_STR=\"$(PROJECT)\"
|
||||
BUILD_LDFLAGS += -Wall
|
||||
FINAL_CPPFLAGS += -D_FILE_OFFSET_BITS=64 -Wall -Wno-unused-value -Wno-deprecated -DPROJECT_STR=\"$(PROJECT)\"
|
||||
FINAL_LDFLAGS += -Wall
|
||||
|
||||
ifeq ($(TARGET_ARCH),$(ARCH_32))
|
||||
BUILD_CPPFLAGS += -m32
|
||||
BUILD_LDFLAGS += -m32
|
||||
FINAL_CPPFLAGS += -m32
|
||||
FINAL_LDFLAGS += -m32
|
||||
endif
|
||||
|
||||
ifneq ($(findstring $(TARGET_ARCH),$(INTEL_ARCHS)),)
|
||||
BUILD_CPPFLAGS += -fPIC
|
||||
FINAL_CPPFLAGS += -fPIC
|
||||
ifeq ($(findstring mingw,$(TARGET_ABI)),)
|
||||
ifeq ($(LIBTYPE),shared)
|
||||
BUILD_LIBFLAGS += -ldl
|
||||
FINAL_LIBFLAGS += -ldl
|
||||
else
|
||||
BUILD_LIBFLAGS += -l:libdl.a
|
||||
FINAL_LIBFLAGS += -l:libdl.a
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),armv7hl)
|
||||
BUILD_CPPFLAGS += -fPIC
|
||||
FINAL_CPPFLAGS += -fPIC
|
||||
else ifeq ($(TARGET_ARCH),aarch64)
|
||||
BUILD_CPPFLAGS += -fPIC
|
||||
FINAL_CPPFLAGS += -fPIC
|
||||
endif
|
||||
|
||||
ifeq ($(DEVELOPMENT),true)
|
||||
BUILD_CPPFLAGS += -D_DEVELOPMENT_
|
||||
FINAL_CPPFLAGS += -D_DEVELOPMENT_
|
||||
export G_SLICE = always-malloc
|
||||
export G_DEBUG = gc-friendly,resident-modules
|
||||
export MALLOC_CHECK_ = 2
|
||||
endif
|
||||
|
||||
ifneq ($(LOG_QUAL_PREFIX),)
|
||||
BUILD_CPPFLAGS += -DKEEP_FILES_OPEN -DLOG_QUAL_PREFIX=\"$(LOG_QUAL_PREFIX)\"
|
||||
FINAL_CPPFLAGS += -DKEEP_FILES_OPEN -DLOG_QUAL_PREFIX=\"$(LOG_QUAL_PREFIX)\"
|
||||
endif
|
||||
|
||||
ifeq ($(CATCH_ONLY_YERROR),true)
|
||||
BUILD_CPPFLAGS += -DCATCH_ONLY_YERROR
|
||||
FINAL_CPPFLAGS += -DCATCH_ONLY_YERROR
|
||||
endif
|
||||
|
||||
ifeq ($(USE_VERSION_MACROS),true)
|
||||
BUILD_CPPFLAGS += -DVERSION=$(HEX_VERSION) -DVERSION_STR=\"$(VERSION)\"
|
||||
FINAL_CPPFLAGS += -DVERSION=$(HEX_VERSION) -DVERSION_STR=\"$(VERSION)\"
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||
|
||||
ifeq ($(TARGET_CPU),cortex-m3)
|
||||
BUILD_CPPFLAGS += -mcpu=cortex-m3 -mthumb
|
||||
BUILD_LDFLAGS += -mcpu=cortex-m3 -mthumb
|
||||
FINAL_CPPFLAGS += -mcpu=cortex-m3 -mthumb
|
||||
FINAL_LDFLAGS += -mcpu=cortex-m3 -mthumb
|
||||
else ifeq ($(TARGET_CPU),cortex-m4)
|
||||
BUILD_CPPFLAGS += -mcpu=cortex-m4 -mthumb
|
||||
BUILD_LDFLAGS += -mcpu=cortex-m4 -mthumb
|
||||
FINAL_CPPFLAGS += -mcpu=cortex-m4 -mthumb
|
||||
FINAL_LDFLAGS += -mcpu=cortex-m4 -mthumb
|
||||
else ifeq ($(TARGET_CPU),cortex-m7)
|
||||
BUILD_CPPFLAGS += -mcpu=cortex-m7 -mthumb
|
||||
BUILD_LDFLAGS += -mcpu=cortex-m7 -mthumb
|
||||
FINAL_CPPFLAGS += -mcpu=cortex-m7 -mthumb
|
||||
FINAL_LDFLAGS += -mcpu=cortex-m7 -mthumb
|
||||
endif
|
||||
|
||||
ifneq ($(findstring cortex-m,$(TARGET_CPU)),)
|
||||
|
||||
# don't wrap error message lines
|
||||
#BUILD_LDFLAGS += -fmessage-length=0
|
||||
#FINAL_LDFLAGS += -fmessage-length=0
|
||||
|
||||
# don't know what kind of optimization that is
|
||||
#BUILD_LDFLAGS += -Og
|
||||
#FINAL_LDFLAGS += -Og
|
||||
|
||||
# stick with what janware code tends to expect
|
||||
BUILD_LDFLAGS += -fsigned-char
|
||||
FINAL_LDFLAGS += -fsigned-char
|
||||
|
||||
# I have no clue which part would evaluate these names
|
||||
BUILD_LDFLAGS += -ffunction-sections
|
||||
BUILD_LDFLAGS += -fdata-sections
|
||||
BUILD_LDFLAGS += -ffreestanding
|
||||
BUILD_LDFLAGS += -fno-move-loop-invariants
|
||||
FINAL_LDFLAGS += -ffunction-sections
|
||||
FINAL_LDFLAGS += -fdata-sections
|
||||
FINAL_LDFLAGS += -ffreestanding
|
||||
FINAL_LDFLAGS += -fno-move-loop-invariants
|
||||
|
||||
# skip any automatic initialization
|
||||
BUILD_LDFLAGS += -nostartfiles
|
||||
FINAL_LDFLAGS += -nostartfiles
|
||||
|
||||
# garbage collect unused input sections
|
||||
BUILD_LDFLAGS += -Xlinker --gc-sections
|
||||
#BUILD_LDFLAGS += -Xlinker --print-gc-sections
|
||||
FINAL_LDFLAGS += -Xlinker --gc-sections
|
||||
#FINAL_LDFLAGS += -Xlinker --print-gc-sections
|
||||
|
||||
# create map file
|
||||
BUILD_LDFLAGS += -Wl,-Map,"$(EXE_MAP)"
|
||||
FINAL_LDFLAGS += -Wl,-Map,"$(EXE_MAP)"
|
||||
|
||||
# use newlib-nano, provides symbols _write _close _fstat _isatty _lseek (at least)
|
||||
# (TODO: No -Wl necessary?)
|
||||
BUILD_LDFLAGS += --specs=nano.specs
|
||||
BUILD_LDFLAGS += --specs=nosys.specs
|
||||
FINAL_LDFLAGS += --specs=nano.specs
|
||||
FINAL_LDFLAGS += --specs=nosys.specs
|
||||
|
||||
endif
|
||||
|
||||
|
|
@ -353,70 +353,70 @@ ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
|||
ifeq ($(USE_DISABLE_COMPILER_OPTIMISATION_OPTS),true)
|
||||
ARM_NONE_EABI_ALLFLAGS += -Os
|
||||
endif
|
||||
BUILD_LDFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
||||
BUILD_CPPFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
||||
BUILD_CXXFLAGS += -fno-rtti
|
||||
FINAL_LDFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
||||
FINAL_CPPFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
||||
FINAL_CXXFLAGS += -fno-rtti
|
||||
|
||||
# -- used by modm, but currently disabled for test purposes
|
||||
#BUILD_CFLAGS += -fno-threadsafe-statics
|
||||
#BUILD_CFLAGS += -fno-unwind-tables
|
||||
#BUILD_CFLAGS += -fstrict-enums
|
||||
#BUILD_CFLAGS += -fuse-cxa-atexit
|
||||
#BUILD_CFLAGS += -fshort-wchar
|
||||
#BUILD_CFLAGS += -fsingle-precision-constant
|
||||
#BUILD_CFLAGS += -funsigned-bitfields
|
||||
#BUILD_CFLAGS += -funsigned-char
|
||||
#BUILD_CFLAGS += -fwrapv
|
||||
#BUILD_CFLAGS += -g3
|
||||
#BUILD_CFLAGS += -gdwarf
|
||||
#BUILD_CFLAGS += -W
|
||||
#BUILD_CFLAGS += -Wall
|
||||
#BUILD_CFLAGS += -Wdouble-promotion
|
||||
#BUILD_CFLAGS += -Wduplicated-cond
|
||||
#BUILD_CFLAGS += -Werror=format
|
||||
#BUILD_CFLAGS += -Werror=maybe-uninitialized
|
||||
#BUILD_CFLAGS += -Werror=overflow
|
||||
#BUILD_CFLAGS += -Werror=sign-compare
|
||||
#BUILD_CFLAGS += -Wextra
|
||||
#BUILD_CFLAGS += -Wlogical-op
|
||||
#BUILD_CFLAGS += -Wpointer-arith
|
||||
#BUILD_CFLAGS += -Wundef
|
||||
#FINAL_CFLAGS += -fno-threadsafe-statics
|
||||
#FINAL_CFLAGS += -fno-unwind-tables
|
||||
#FINAL_CFLAGS += -fstrict-enums
|
||||
#FINAL_CFLAGS += -fuse-cxa-atexit
|
||||
#FINAL_CFLAGS += -fshort-wchar
|
||||
#FINAL_CFLAGS += -fsingle-precision-constant
|
||||
#FINAL_CFLAGS += -funsigned-bitfields
|
||||
#FINAL_CFLAGS += -funsigned-char
|
||||
#FINAL_CFLAGS += -fwrapv
|
||||
#FINAL_CFLAGS += -g3
|
||||
#FINAL_CFLAGS += -gdwarf
|
||||
#FINAL_CFLAGS += -W
|
||||
#FINAL_CFLAGS += -Wall
|
||||
#FINAL_CFLAGS += -Wdouble-promotion
|
||||
#FINAL_CFLAGS += -Wduplicated-cond
|
||||
#FINAL_CFLAGS += -Werror=format
|
||||
#FINAL_CFLAGS += -Werror=maybe-uninitialized
|
||||
#FINAL_CFLAGS += -Werror=overflow
|
||||
#FINAL_CFLAGS += -Werror=sign-compare
|
||||
#FINAL_CFLAGS += -Wextra
|
||||
#FINAL_CFLAGS += -Wlogical-op
|
||||
#FINAL_CFLAGS += -Wpointer-arith
|
||||
#FINAL_CFLAGS += -Wundef
|
||||
|
||||
|
||||
#BUILD_CXXFLAGS += -fdata-sections
|
||||
#BUILD_CXXFLAGS += -ffunction-sections
|
||||
#BUILD_CXXFLAGS += -finline-limit=10000
|
||||
#BUILD_CPPFLAGS += -fshort-wchar
|
||||
#BUILD_CPPFLAGS += -fsingle-precision-constant
|
||||
#BUILD_CPPFLAGS += -funsigned-bitfields
|
||||
#BUILD_CPPFLAGS += -funsigned-char
|
||||
#BUILD_CPPFLAGS += -fwrapv
|
||||
#BUILD_CPPFLAGS += -g3
|
||||
#BUILD_CPPFLAGS += -gdwarf
|
||||
#BUILD_CPPFLAGS += -W
|
||||
#BUILD_CPPFLAGS += -Wall
|
||||
#BUILD_CPPFLAGS += -Wdouble-promotion
|
||||
#BUILD_CPPFLAGS += -Wduplicated-cond
|
||||
#BUILD_CPPFLAGS += -Werror=format
|
||||
#BUILD_CPPFLAGS += -Werror=maybe-uninitialized
|
||||
#BUILD_CPPFLAGS += -Werror=overflow
|
||||
#BUILD_CPPFLAGS += -Werror=sign-compare
|
||||
#BUILD_CPPFLAGS += -Wextra
|
||||
#BUILD_CPPFLAGS += -Wlogical-op
|
||||
#BUILD_CXXFLAGS += -Wpointer-arith
|
||||
#BUILD_CPPFLAGS += -Wundef
|
||||
#BUILD_CXXFLAGS += -fno-threadsafe-statics
|
||||
#BUILD_CPPFLAGS += -fno-unwind-tables
|
||||
#BUILD_CXXFLAGS += -fstrict-enums
|
||||
#BUILD_CPPFLAGS += -fuse-cxa-atexit
|
||||
#BUILD_CXXFLAGS += -std=c++17
|
||||
#BUILD_CXXFLAGS += -Woverloaded-virtual
|
||||
#BUILD_CXXFLAGS += -fno-move-loop-invariants
|
||||
#BUILD_CPPFLAGS += -fno-split-wide-types
|
||||
#BUILD_CPPFLAGS += -fno-tree-loop-optimize
|
||||
#FINAL_CXXFLAGS += -fdata-sections
|
||||
#FINAL_CXXFLAGS += -ffunction-sections
|
||||
#FINAL_CXXFLAGS += -finline-limit=10000
|
||||
#FINAL_CPPFLAGS += -fshort-wchar
|
||||
#FINAL_CPPFLAGS += -fsingle-precision-constant
|
||||
#FINAL_CPPFLAGS += -funsigned-bitfields
|
||||
#FINAL_CPPFLAGS += -funsigned-char
|
||||
#FINAL_CPPFLAGS += -fwrapv
|
||||
#FINAL_CPPFLAGS += -g3
|
||||
#FINAL_CPPFLAGS += -gdwarf
|
||||
#FINAL_CPPFLAGS += -W
|
||||
#FINAL_CPPFLAGS += -Wall
|
||||
#FINAL_CPPFLAGS += -Wdouble-promotion
|
||||
#FINAL_CPPFLAGS += -Wduplicated-cond
|
||||
#FINAL_CPPFLAGS += -Werror=format
|
||||
#FINAL_CPPFLAGS += -Werror=maybe-uninitialized
|
||||
#FINAL_CPPFLAGS += -Werror=overflow
|
||||
#FINAL_CPPFLAGS += -Werror=sign-compare
|
||||
#FINAL_CPPFLAGS += -Wextra
|
||||
#FINAL_CPPFLAGS += -Wlogical-op
|
||||
#FINAL_CXXFLAGS += -Wpointer-arith
|
||||
#FINAL_CPPFLAGS += -Wundef
|
||||
#FINAL_CXXFLAGS += -fno-threadsafe-statics
|
||||
#FINAL_CPPFLAGS += -fno-unwind-tables
|
||||
#FINAL_CXXFLAGS += -fstrict-enums
|
||||
#FINAL_CPPFLAGS += -fuse-cxa-atexit
|
||||
#FINAL_CXXFLAGS += -std=c++17
|
||||
#FINAL_CXXFLAGS += -Woverloaded-virtual
|
||||
#FINAL_CXXFLAGS += -fno-move-loop-invariants
|
||||
#FINAL_CPPFLAGS += -fno-split-wide-types
|
||||
#FINAL_CPPFLAGS += -fno-tree-loop-optimize
|
||||
|
||||
#BUILD_CPPFLAGS += -fno-exceptions
|
||||
#BUILD_CXXFLAGS += -fno-rtti
|
||||
#FINAL_CPPFLAGS += -fno-exceptions
|
||||
#FINAL_CXXFLAGS += -fno-rtti
|
||||
|
||||
ifneq ($(findstring gnu-mcu-eclipse,$(TAGGED_TMPL_TAGS)),)
|
||||
LD_DEFINE_SYMBOLS += _sbrk
|
||||
|
|
@ -424,7 +424,7 @@ ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
|||
|
||||
endif
|
||||
|
||||
BUILD_LDFLAGS += $(addprefix -u ,$(LD_DEFINE_SYMBOLS))
|
||||
FINAL_LDFLAGS += $(addprefix -u ,$(LD_DEFINE_SYMBOLS))
|
||||
|
||||
# -- target files and dirs
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ ALL_CSRC += $(LOCAL_CSRC) $(PREREQ_CSRC)
|
|||
CORE += $(filter-out $(wildcard *.intern-state*),$(wildcard core core.* vgcore vgcore.*))
|
||||
|
||||
ifeq ($(GCC_MAJOR),4)
|
||||
BUILD_CPPFLAGS += -DGCC_HASCLASSVISIBILITY
|
||||
FINAL_CPPFLAGS += -DGCC_HASCLASSVISIBILITY
|
||||
endif
|
||||
|
||||
ifeq ($(USE_QT),true)
|
||||
|
|
@ -472,33 +472,33 @@ ifeq ($(USE_QT),true)
|
|||
endif
|
||||
|
||||
ifeq ($(USE_X),true)
|
||||
BUILD_LDFLAGS += -L/usr/X11/$(SYSTEM_LIBDIR_NAME) -lXext -lX11
|
||||
FINAL_LDFLAGS += -L/usr/X11/$(SYSTEM_LIBDIR_NAME) -lXext -lX11
|
||||
endif
|
||||
|
||||
ifneq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||
BUILD_LPPFLAGS += -lstdc++
|
||||
FINAL_LPPFLAGS += -lstdc++
|
||||
endif
|
||||
|
||||
ifeq ($(GCC_MAJOR),2)
|
||||
BUILD_LPPFLAGS += -lm
|
||||
BUILD_CPPFLAGS += -I/usr/local/include
|
||||
FINAL_LPPFLAGS += -lm
|
||||
FINAL_CPPFLAGS += -I/usr/local/include
|
||||
else
|
||||
ifeq ($(GCC_MAJOR),3)
|
||||
ifeq ($(GCC_MINOR),3)
|
||||
BUILD_LPPFLAGS += -lgcc_s
|
||||
# BUILD_LPPFLAGS += -L/usr/local/gcc3.3/lib
|
||||
FINAL_LPPFLAGS += -lgcc_s
|
||||
# FINAL_LPPFLAGS += -L/usr/local/gcc3.3/lib
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),mingw)
|
||||
BUILD_CPPFLAGS += -DWIN32
|
||||
FINAL_CPPFLAGS += -DWIN32
|
||||
# see https://stackoverflow.com/questions/4492799
|
||||
BUILD_LDFLAGS += -fstack-protector
|
||||
FINAL_LDFLAGS += -fstack-protector
|
||||
endif
|
||||
|
||||
ifeq ($(LOG_THREAD_NAMES), true)
|
||||
BUILD_CPPFLAGS += -DSLOG_THREAD_NAMES
|
||||
FINAL_CPPFLAGS += -DSLOG_THREAD_NAMES
|
||||
endif
|
||||
|
||||
# ----- standard features, switched on with USE_XXX = true
|
||||
|
|
@ -518,21 +518,21 @@ endif
|
|||
|
||||
ifneq ($(filter jw-build,$(PREREQ_BUILD)),)
|
||||
ifeq ($(TARGET),mingw)
|
||||
JW_BUILD_LDFLAGS += -lglib-2.0 -lws2_32 -lstdc++
|
||||
JW_FINAL_LDFLAGS += -lglib-2.0 -lws2_32 -lstdc++
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SYSTEMD),true)
|
||||
BUILD_CPPFLAGS += -D_USE_SYSTEMD_ $(shell $(PKG_CONFIG_EXE) --cflags libsystemd)
|
||||
BUILD_LDFLAGS += $(shell $(PKG_CONFIG_EXE) --libs libsystemd)
|
||||
FINAL_CPPFLAGS += -D_USE_SYSTEMD_ $(shell $(PKG_CONFIG_EXE) --cflags libsystemd)
|
||||
FINAL_LDFLAGS += $(shell $(PKG_CONFIG_EXE) --libs libsystemd)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_TIMER),true)
|
||||
BUILD_CPPFLAGS += -D_USE_TIMER_
|
||||
FINAL_CPPFLAGS += -D_USE_TIMER_
|
||||
endif
|
||||
|
||||
ifeq ($(USE_FAST_LOG),false)
|
||||
BUILD_CPPFLAGS += -D_USE_FAST_LOG_=0
|
||||
FINAL_CPPFLAGS += -D_USE_FAST_LOG_=0
|
||||
endif
|
||||
|
||||
ifeq ($(USE_YAMD),true)
|
||||
|
|
@ -540,87 +540,87 @@ ifeq ($(USE_YAMD),true)
|
|||
endif
|
||||
|
||||
ifeq ($(USE_MPATROL),true)
|
||||
#BUILD_CPPFLAGS += -include /usr/include/mpatrol.h
|
||||
BUILD_LDFLAGS += -lmpatrolmt -lbfd -liberty
|
||||
#FINAL_CPPFLAGS += -include /usr/include/mpatrol.h
|
||||
FINAL_LDFLAGS += -lmpatrolmt -lbfd -liberty
|
||||
endif
|
||||
|
||||
ifeq ($(USE_VALGRIND),true)
|
||||
BUILD_CPPFLAGS += -include /usr/include/valgrind/memcheck.h -D_VALGRIND_
|
||||
# BUILD_LDFLAGS +=
|
||||
FINAL_CPPFLAGS += -include /usr/include/valgrind/memcheck.h -D_VALGRIND_
|
||||
# FINAL_LDFLAGS +=
|
||||
endif
|
||||
|
||||
ifeq ($(USE_MCHECK),true)
|
||||
BUILD_LDFLAGS += -lmcheck
|
||||
FINAL_LDFLAGS += -lmcheck
|
||||
endif
|
||||
|
||||
ifeq ($(USE_STACK_PROTECTOR),true)
|
||||
BUILD_CPPFLAGS += -fstack-protector-all
|
||||
#BUILD_CPPFLAGS += -fstack-protector
|
||||
FINAL_CPPFLAGS += -fstack-protector-all
|
||||
#FINAL_CPPFLAGS += -fstack-protector
|
||||
endif
|
||||
|
||||
ifeq ($(USE_STACK_CHECKER),true)
|
||||
ifeq "$(COMPILER_SUITE)" "clang"
|
||||
BUILD_CPPFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||
BUILD_LDFLAGS += -fsanitize=address
|
||||
FINAL_CPPFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||
FINAL_LDFLAGS += -fsanitize=address
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_DBMALLOC),true)
|
||||
CONTRIB_LIBS += dbmalloc
|
||||
BUILD_CPPFLAGS += -DDBMALLOC -DEXITFUN=_exit -I$(TOPDIR)/contrib/dbmalloc
|
||||
BUILD_LDFLAGS += -ldbmalloc
|
||||
FINAL_CPPFLAGS += -DDBMALLOC -DEXITFUN=_exit -I$(TOPDIR)/contrib/dbmalloc
|
||||
FINAL_LDFLAGS += -ldbmalloc
|
||||
endif
|
||||
|
||||
ifeq ($(USE_DMALLOC),true)
|
||||
BUILD_CPPFLAGS += -DDMALLOC -DDMALLOC_FUNC_CHECK -DSTORE_SEEN_COUNT
|
||||
BUILD_LDFLAGS += -ldmallocthcxx -ldmallocth
|
||||
FINAL_CPPFLAGS += -DDMALLOC -DDMALLOC_FUNC_CHECK -DSTORE_SEEN_COUNT
|
||||
FINAL_LDFLAGS += -ldmallocthcxx -ldmallocth
|
||||
endif
|
||||
|
||||
ifeq ($(USE_MEMWATCH),true)
|
||||
BUILD_CPPFLAGS += -DMEMWATCH -DMW_STDIO
|
||||
FINAL_CPPFLAGS += -DMEMWATCH -DMW_STDIO
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EFENCE),true)
|
||||
BUILD_CPPFLAGS += -DEFENCE
|
||||
BUILD_LDFLAGS += -lefence
|
||||
FINAL_CPPFLAGS += -DEFENCE
|
||||
FINAL_LDFLAGS += -lefence
|
||||
endif
|
||||
|
||||
ifeq ($(USE_TRACING),true)
|
||||
BUILD_CPPFLAGS += -D_DO_TRACE_
|
||||
FINAL_CPPFLAGS += -D_DO_TRACE_
|
||||
endif
|
||||
|
||||
ifeq ($(USE_ASSERTIONS),false)
|
||||
BUILD_CPPFLAGS += -DNDEBUG
|
||||
FINAL_CPPFLAGS += -DNDEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILE_DEBUG_CODE),true)
|
||||
BUILD_CPPFLAGS += -D_DEBUG_
|
||||
FINAL_CPPFLAGS += -D_DEBUG_
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILE_DEBUG_LOG),true)
|
||||
BUILD_CPPFLAGS += -D_LOG_DEBUG_
|
||||
FINAL_CPPFLAGS += -D_LOG_DEBUG_
|
||||
endif
|
||||
|
||||
ifeq ($(USE_MPATROL),true)
|
||||
BUILD_CPPFLAGS += -include $(MODDIR)/include/mpatrol.h
|
||||
BUILD_LDFLAGS += -lmpatrolmt -lbfd -liberty
|
||||
FINAL_CPPFLAGS += -include $(MODDIR)/include/mpatrol.h
|
||||
FINAL_LDFLAGS += -lmpatrolmt -lbfd -liberty
|
||||
endif
|
||||
|
||||
ifeq ($(BREAK_ABI),true)
|
||||
BUILD_CPPFLAGS += -D_BREAK_ABI_
|
||||
FINAL_CPPFLAGS += -D_BREAK_ABI_
|
||||
endif
|
||||
|
||||
ifeq ($(USE_STACK_CHECK),true)
|
||||
BUILD_CPPFLAGS += -fstack-check
|
||||
FINAL_CPPFLAGS += -fstack-check
|
||||
endif
|
||||
|
||||
ifeq ($(USE_COMPILER_DEBUG_OPTS),true)
|
||||
#BUILD_EXTRA_DEBUG_FLAGS += -gdwarf-2
|
||||
BUILD_CPPFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||
BUILD_LDFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||
#FINAL_EXTRA_DEBUG_FLAGS += -gdwarf-2
|
||||
FINAL_CPPFLAGS += -g3 $(FINAL_EXTRA_DEBUG_FLAGS)
|
||||
FINAL_LDFLAGS += -g3 $(FINAL_EXTRA_DEBUG_FLAGS)
|
||||
ifneq ($(USE_COMPILER_OPTIMIZATION_OPTS),true)
|
||||
BUILD_CPPFLAGS += -Og
|
||||
BUILD_LDFLAGS += -Og
|
||||
FINAL_CPPFLAGS += -Og
|
||||
FINAL_LDFLAGS += -Og
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
@ -631,11 +631,11 @@ ifeq ($(CC),$(GCC))
|
|||
-fno-early-inlining \
|
||||
-fno-default-inline
|
||||
else ifeq ($(CC),$(CLANG))
|
||||
BUILD_CPPFLAGS += -Werror
|
||||
FINAL_CPPFLAGS += -Werror
|
||||
endif
|
||||
|
||||
ifeq ($(USE_COMPILER_OPTIMIZATION_OPTS),true)
|
||||
BUILD_CPPFLAGS += -funroll-loops -O3
|
||||
FINAL_CPPFLAGS += -funroll-loops -O3
|
||||
else ifeq ($(USE_DISABLE_COMPILER_OPTIMISATION_OPTS),true)
|
||||
NO_OPT_FLAGS = \
|
||||
-O0 -g -fno-inline -fno-omit-frame-pointer \
|
||||
|
|
@ -657,12 +657,12 @@ else ifeq ($(USE_DISABLE_COMPILER_OPTIMISATION_OPTS),true)
|
|||
-fno-inline-functions \
|
||||
$(GCC_NO_OPT_FLAGS)
|
||||
|
||||
BUILD_CPPFLAGS += $(NO_OPT_FLAGS)
|
||||
BUILD_LDFLAGS += $(NO_OPT_FLAGS)
|
||||
FINAL_CPPFLAGS += $(NO_OPT_FLAGS)
|
||||
FINAL_LDFLAGS += $(NO_OPT_FLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EXCEPTIONS_IN_C),true)
|
||||
BUILD_CFLAGS += -fexceptions
|
||||
FINAL_CFLAGS += -fexceptions
|
||||
ifeq ($(LIBTYPE),shared)
|
||||
GCC_LDFLAGS += -shared-libgcc
|
||||
endif
|
||||
|
|
@ -672,42 +672,42 @@ ifeq ($(STRIP_SYMBOLS),true)
|
|||
STRIP_DONE ?= strip.done
|
||||
endif
|
||||
|
||||
BUILD_INCLUDE += $(LOCAL_INCLUDE)
|
||||
FINAL_INCLUDE += $(LOCAL_INCLUDE)
|
||||
|
||||
# force use of double quotes, allow header namespaces
|
||||
ifeq ($(HDRDIR_SCOPE_SUFFIX),)
|
||||
BUILD_INCLUDE += -I.
|
||||
FINAL_INCLUDE += -I.
|
||||
else
|
||||
BUILD_INCLUDE += -iquote .
|
||||
FINAL_INCLUDE += -iquote .
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PROJECT_LIB),true)
|
||||
BUILD_INCLUDE += $(PROJECT_INCLUDE) -I$(TOPDIR)/include
|
||||
BUILD_LIBFLAGS += -L$(BUILD_LIBDIR)
|
||||
FINAL_INCLUDE += $(PROJECT_INCLUDE) -I$(TOPDIR)/include
|
||||
FINAL_LIBFLAGS += -L$(BUILD_LIBDIR)
|
||||
endif
|
||||
|
||||
BUILD_INCLUDE += $(call proj_query, cflags $(PREREQ_BUILD) $(PROJECT))
|
||||
FINAL_INCLUDE += $(call proj_query, cflags $(PREREQ_BUILD) $(PROJECT))
|
||||
|
||||
LDFLAGS_QUERY_ARGS = $(addprefix --exclude ,$(LDFLAGS_EXCLUDE))
|
||||
BUILD_LIBFLAGS += $(call proj_query, ldflags $(LDFLAGS_QUERY_ARGS) --add-self $(PREREQ_BUILD))
|
||||
FINAL_LIBFLAGS += $(call proj_query, ldflags $(LDFLAGS_QUERY_ARGS) --add-self $(PREREQ_BUILD))
|
||||
|
||||
# the following is necessary, because not all projects have build.libname = none in project.conf
|
||||
ifeq ($(USE_PROJECT_LIB),true)
|
||||
LDFLAGS_QUERY_ARGS_SELF = --add-self
|
||||
endif
|
||||
BUILD_LIBFLAGS += $(call proj_query, ldflags $(LDFLAGS_QUERY_ARGS) $(LDFLAGS_QUERY_ARGS_SELF) $(PROJECT))
|
||||
FINAL_LIBFLAGS += $(call proj_query, ldflags $(LDFLAGS_QUERY_ARGS) $(LDFLAGS_QUERY_ARGS_SELF) $(PROJECT))
|
||||
|
||||
ifeq ($(USE_SNDFILE),true)
|
||||
BUILD_LIBFLAGS += -lsndfile
|
||||
FINAL_LIBFLAGS += -lsndfile
|
||||
endif
|
||||
|
||||
ifeq ($(USE_FFTW),true)
|
||||
BUILD_LIBFLAGS += -lfftw3
|
||||
FINAL_LIBFLAGS += -lfftw3
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GLIB),true)
|
||||
BUILD_CPPFLAGS += $(shell $(PKG_CONFIG_EXE) --cflags glib-2.0)
|
||||
BUILD_LIBFLAGS += $(shell $(PKG_CONFIG_EXE) --libs glib-2.0)
|
||||
FINAL_CPPFLAGS += $(shell $(PKG_CONFIG_EXE) --cflags glib-2.0)
|
||||
FINAL_LIBFLAGS += $(shell $(PKG_CONFIG_EXE) --libs glib-2.0)
|
||||
endif
|
||||
|
||||
ifeq ($(CC),$(CLANG))
|
||||
|
|
@ -724,18 +724,18 @@ ifeq ($(CC),$(GCC))
|
|||
COMPILER_LDFLAGS += $(GCC_LDFLAGS)
|
||||
endif
|
||||
|
||||
BUILD_CFLAGS += $(LOCAL_CFLAGS) $(PROJECT_CFLAGS) $(COMPLILER_CFLAGS) $(BUILD_INCLUDE)
|
||||
BUILD_CPPFLAGS += $(LOCAL_CPPFLAGS) $(PROJECT_INCLUDE) $(PROJECT_CPPFLAGS) $(COMPILER_CPPFLAGS) $(BUILD_INCLUDE)
|
||||
BUILD_CXXFLAGS += $(LOCAL_CXXFLAGS) $(PROJECT_CXXFLAGS) $(COMPILER_CXXFLAGS) $(BUILD_INCLUDE)
|
||||
BUILD_LDFLAGS += $(LOCAL_LDFLAGS) $(PROJECTLIB_LDFLAGS) $(PROJECT_LDFLAGS) $(COMPILER_LDFLAGS) $(BUILD_LPPFLAGS) $(BUILD_LIBFLAGS)
|
||||
FINAL_CFLAGS += $(LOCAL_CFLAGS) $(PROJECT_CFLAGS) $(COMPLILER_CFLAGS) $(FINAL_INCLUDE)
|
||||
FINAL_CPPFLAGS += $(LOCAL_CPPFLAGS) $(PROJECT_INCLUDE) $(PROJECT_CPPFLAGS) $(COMPILER_CPPFLAGS) $(FINAL_INCLUDE)
|
||||
FINAL_CXXFLAGS += $(LOCAL_CXXFLAGS) $(PROJECT_CXXFLAGS) $(COMPILER_CXXFLAGS) $(FINAL_INCLUDE)
|
||||
FINAL_LDFLAGS += $(LOCAL_LDFLAGS) $(PROJECTLIB_LDFLAGS) $(PROJECT_LDFLAGS) $(COMPILER_LDFLAGS) $(FINAL_LPPFLAGS) $(FINAL_LIBFLAGS)
|
||||
|
||||
#RPM_REQUIRES = $(shell $(ECHO) "$(RPM_REQUIRES_RUN) $(RPM_REQUIRES_DEVEL)" | $(add_flavour_prefix))
|
||||
RPM_REQUIRES += $(RPM_REQUIRES_RUN) $(RPM_REQUIRES_DEVEL)
|
||||
|
||||
REAL_CFLAGS ?= $(BUILD_CFLAGS)
|
||||
REAL_CPPFLAGS ?= $(BUILD_CPPFLAGS)
|
||||
REAL_CXXFLAGS ?= $(BUILD_CXXFLAGS)
|
||||
REAL_LDFLAGS ?= $(BUILD_LDFLAGS)
|
||||
REAL_CFLAGS ?= $(FINAL_CFLAGS)
|
||||
REAL_CPPFLAGS ?= $(FINAL_CPPFLAGS)
|
||||
REAL_CXXFLAGS ?= $(FINAL_CXXFLAGS)
|
||||
REAL_LDFLAGS ?= $(FINAL_LDFLAGS)
|
||||
|
||||
# -- LIB
|
||||
INSTALLATION_FILE_TYPES += LIB
|
||||
|
|
@ -759,11 +759,11 @@ INSTALL_LIBDIR ?= $(EXE_PREFIX)/lib
|
|||
|
||||
ifeq ($(LIBTYPE),shared)
|
||||
ifneq ($(TARGET),mingw)
|
||||
BUILD_LDFLAGS += -rdynamic
|
||||
FINAL_LDFLAGS += -rdynamic
|
||||
endif
|
||||
else
|
||||
LIB_SO ?=
|
||||
BUILD_LDFLAGS += -static
|
||||
FINAL_LDFLAGS += -static
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PROJECT_LIB),true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue