summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2019-07-27 10:49:34 (GMT)
committer Hanhui <sylixos@gmail.com>2019-07-15 14:38:52 (GMT)
commit2f1b3e6647fa4d786e77e088c0bd9fdc6eacd3d3 (patch)
tree308e5c50c0e71e2e2986ac16748cc251d6f504c0
parent5d963a83f5a8ef7287b39d96ef6f0145608bb84a (diff)
downloadAIC-OS-2f1b3e6647fa4d786e77e088c0bd9fdc6eacd3d3.zip
Update c6x make template to support new tool chain.
-rw-r--r--SylixOS/mktemp/cl6x.mk9
-rw-r--r--SylixOS/mktemp/common.mk12
2 files changed, 14 insertions, 7 deletions
diff --git a/SylixOS/mktemp/cl6x.mk b/SylixOS/mktemp/cl6x.mk
index bfaa925..3600a33 100644
--- a/SylixOS/mktemp/cl6x.mk
+++ b/SylixOS/mktemp/cl6x.mk
@@ -86,21 +86,16 @@ TOOLCHAIN_LINK_SYLIXOS = -llibsylixos.a
TOOLCHAIN_LINK_GCOV =
TOOLCHAIN_LINK_GCOV_KO =
TOOLCHAIN_LINK_OMP =
-TOOLCHAIN_LINK_CXX = cplusplus
+TOOLCHAIN_LINK_CXX = --cplusplus
TOOLCHAIN_LINK_M =
TOOLCHAIN_LINK_GCC = -llibrts$(CPU_TYPE)_elf.a
TOOLCHAIN_LINK_GTEST =
TOOLCHAIN_LINK_PIC_GCOV =
TOOLCHAIN_LINK_PIC_OMP =
-TOOLCHAIN_LINK_PIC_CXX = cplusplus
-ifeq ($(DEBUG_LEVEL), debug)
-TOOLCHAIN_LINK_PIC_M = -Wl,-static -lm
-TOOLCHAIN_LINK_PIC_GCC = -Wl,-static -lgcc
-else
+TOOLCHAIN_LINK_PIC_CXX = --cplusplus
TOOLCHAIN_LINK_PIC_M =
TOOLCHAIN_LINK_PIC_GCC = -llibrts$(CPU_TYPE)_elf_pic.a
-endif
#*********************************************************************************************************
# Toolchain include & define
diff --git a/SylixOS/mktemp/common.mk b/SylixOS/mktemp/common.mk
index cce026a..cd879f6 100644
--- a/SylixOS/mktemp/common.mk
+++ b/SylixOS/mktemp/common.mk
@@ -181,6 +181,17 @@ $(OBJPATH)/$(target)/%.o: %.asm
@-$(DEPFIX) $(__PP) $(__DEP)
@-rm -rf $(__PP)
+ifeq ($($(target)_USE_CXX), yes)
+$(OBJPATH)/$(target)/%.o: %.c
+ @if [ ! -d "$(dir $@)" ]; then \
+ mkdir -p "$(dir $@)"; fi
+ @if [ ! -d "$(dir $(__PP))" ]; then \
+ mkdir -p "$(dir $(__PP))"; fi
+ @-rm -rf $(__DEP)
+ $(CC) $($(__TARGET)_CFLAGS) --preproc_with_compile --cplusplus --preproc_dependency=$(__PP) $< -fe=$@
+ @-$(DEPFIX) $(__PP) $(__DEP)
+ @-rm -rf $(__PP)
+else
$(OBJPATH)/$(target)/%.o: %.c
@if [ ! -d "$(dir $@)" ]; then \
mkdir -p "$(dir $@)"; fi
@@ -190,6 +201,7 @@ $(OBJPATH)/$(target)/%.o: %.c
$(CC) $($(__TARGET)_CFLAGS) --preproc_with_compile --preproc_dependency=$(__PP) $< -fe=$@
@-$(DEPFIX) $(__PP) $(__DEP)
@-rm -rf $(__PP)
+endif
$(OBJPATH)/$(target)/%.o: %.cpp
@if [ ! -d "$(dir $@)" ]; then \