mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
defs-cpp.mk, mcu-defs.mk, rules.mk: Code beautification and re-ordering
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
419d3b2a08
commit
ed76759a42
3 changed files with 79 additions and 91 deletions
|
|
@ -72,11 +72,6 @@ ifneq ($(TARGET_TRIPLET),$(HOST_TRIPLET)) # we're cross-compiling
|
|||
else # we're not cross-compiling
|
||||
|
||||
TC_SYS_ROOT ?= /usr
|
||||
ifeq ($(LIBTYPE),shared)
|
||||
LIBFLAGS += -ldl
|
||||
else
|
||||
LIBFLAGS += -l:libdl.a
|
||||
endif
|
||||
LIBFLAGS += -pthread
|
||||
|
||||
endif
|
||||
|
|
@ -107,7 +102,7 @@ ifeq ($(COMPILER_SUITE),gcc)
|
|||
|
||||
# Not needed anywhere
|
||||
#GNU_LD_VERSION := $(shell $(LD) -V | $(SED) '/GNU ld/ !d; s/(.*)//; s/[^0-9.-]*//')
|
||||
#GNU_LD_VERSION_NUMBERS := $(subst ., ,$(GNU_LD_VERSION))
|
||||
#GNU_LD_VERSION_NUMBERS := $(subst ., ,$(GNU_LD_VERSION))
|
||||
#GNU_LD_MAJOR := $(word 1,$(GNU_LD_VERSION_NUMBERS))
|
||||
#GNU_LD_MINOR := $(word 2,$(GNU_LD_VERSION_NUMBERS))
|
||||
#GNU_LD_REV := $(word 3,$(GNU_LD_VERSION_NUMBERS))
|
||||
|
|
@ -139,6 +134,27 @@ else ifeq ($(COMPILER_SUITE),clang)
|
|||
|
||||
endif # COMPILER_SUITE
|
||||
|
||||
# -- jw-build variables based on arch and toolchain
|
||||
|
||||
ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||
LIBTYPE ?= static
|
||||
else
|
||||
LIBTYPE ?= shared
|
||||
endif
|
||||
|
||||
INTEL_ARCHS := i386 i486 i586 i686 x86_64
|
||||
|
||||
ifneq ($(findstring $(TARGET_ARCH),$(INTEL_ARCHS)),)
|
||||
TAGGED_TMPL_TAGS += x86
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER_SUITE),gcc)
|
||||
DEBUGGER ?= gdb
|
||||
BUILD_EXTRA_DEBUG_FLAGS += -ggdb
|
||||
else ifeq ($(COMPILER_SUITE),clang)
|
||||
DEBUGGER = lldb
|
||||
endif
|
||||
|
||||
# -- gather compiler options in BUILD_XXXFLAGS
|
||||
|
||||
BUILD_CFLAGS += $(CFLAGS)
|
||||
|
|
@ -154,9 +170,13 @@ ifeq ($(TARGET_ARCH),$(ARCH_32))
|
|||
PROJECT_LDFLAGS += -m32
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),x86_64)
|
||||
ifneq ($(findstring $(TARGET_ARCH),$(INTEL_ARCHS)),)
|
||||
BUILD_CPPFLAGS += -fPIC
|
||||
LIBFLAGS +=
|
||||
ifeq ($(LIBTYPE),shared)
|
||||
LIBFLAGS += -ldl
|
||||
else
|
||||
LIBFLAGS += -l:libdl.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),armv7hl)
|
||||
|
|
@ -165,22 +185,8 @@ else ifeq ($(TARGET_ARCH),aarch64)
|
|||
PROJECT_CPPFLAGS += -fPIC
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||
LIBTYPE ?= static
|
||||
else
|
||||
LIBTYPE ?= shared
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER_SUITE),gcc)
|
||||
DEBUGGER ?= gdb
|
||||
BUILD_EXTRA_DEBUG_FLAGS += -ggdb
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER_SUITE),clang)
|
||||
DEBUGGER = lldb
|
||||
endif
|
||||
|
||||
ifeq ($(DEVELOPMENT),true)
|
||||
BUILD_CPPFLAGS += -D_DEVELOPMENT_
|
||||
export G_SLICE = always-malloc
|
||||
export G_DEBUG = gc-friendly,resident-modules
|
||||
export MALLOC_CHECK_ = 2
|
||||
|
|
@ -359,12 +365,6 @@ ALL_C += $(LOCAL_C) $(PREREQ_CPP)
|
|||
ALL_CPP += $(LOCAL_CPP) $(PREREQ_CPP)
|
||||
ALL_CSRC += $(LOCAL_CSRC) $(PREREQ_CSRC)
|
||||
|
||||
# ==
|
||||
|
||||
ifeq ($(DEVELOPMENT),true)
|
||||
BUILD_CPPFLAGS += -D_DEVELOPMENT_
|
||||
endif
|
||||
|
||||
CORE += $(filter-out $(wildcard *.intern-state*),$(wildcard core core.* vgcore vgcore.*))
|
||||
|
||||
ifeq ($(GCC_MAJOR),4)
|
||||
|
|
@ -402,10 +402,6 @@ ifeq ($(TARGET),mingw)
|
|||
BUILD_LDFLAGS += -fstack-protector
|
||||
endif
|
||||
|
||||
# TODO: this shoud be only conditional, but breaks, because not all headers
|
||||
# do a conditional include of timer headers, yet
|
||||
GENERATE_FUNC_TIMERS = $(MODDIR)/YStopWatchThreadList/generate_func_timers.sh
|
||||
|
||||
ifeq ($(LOG_THREAD_NAMES), true)
|
||||
BUILD_CPPFLAGS += -DSLOG_THREAD_NAMES
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue