From 3f97a87162c5d16a2cb17addaaab075d8338c4a3 Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Mon, 30 Jan 2023 15:20:55 +0800 Subject: [PATCH] tools: add separate flags parameter for COMPILE/COMPILEXX Signed-off-by: yinshengkai --- arch/arm/src/Makefile | 2 +- arch/arm64/src/Makefile | 2 +- arch/risc-v/src/Makefile | 2 +- arch/sim/src/Makefile | 2 +- arch/xtensa/src/Makefile | 2 +- tools/Config.mk | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile index 41d6105a3d..4e0c7b7767 100644 --- a/arch/arm/src/Makefile +++ b/arch/arm/src/Makefile @@ -172,7 +172,7 @@ board$(DELIM)libboard$(LIBEXT): define LINK_ALLSYMS $(Q) $(TOPDIR)/tools/mkallsyms.py $(NUTTX) allsyms.tmp - $(Q) $(call COMPILE, -x c allsyms.tmp, allsyms$(OBJEXT)) + $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c) $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \ -o $(NUTTX) $(HEAD_OBJ) allsyms$(OBJEXT) $(EXTRA_OBJS) \ $(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP) diff --git a/arch/arm64/src/Makefile b/arch/arm64/src/Makefile index 5ccb375012..4dd63205b5 100644 --- a/arch/arm64/src/Makefile +++ b/arch/arm64/src/Makefile @@ -126,7 +126,7 @@ board$(DELIM)libboard$(LIBEXT): define LINK_ALLSYMS $(Q) $(TOPDIR)/tools/mkallsyms.sh $(NUTTX) $(CROSSDEV) > allsyms.tmp - $(Q) $(call COMPILE, -x c allsyms.tmp, allsyms$(OBJEXT)) + $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c) $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \ -o $(NUTTX) $(HEAD_OBJ) allsyms$(OBJEXT) $(EXTRA_OBJS) \ $(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP) diff --git a/arch/risc-v/src/Makefile b/arch/risc-v/src/Makefile index 020f965891..c61f29de56 100644 --- a/arch/risc-v/src/Makefile +++ b/arch/risc-v/src/Makefile @@ -153,7 +153,7 @@ board/libboard$(LIBEXT): define LINK_ALLSYMS $(Q) $(TOPDIR)/tools/mkallsyms.py $(NUTTX) allsyms.tmp - $(Q) $(call COMPILE, -x c allsyms.tmp, allsyms$(OBJEXT)) + $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c) $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \ -o $(NUTTX) $(HEAD_OBJ) allsyms$(OBJEXT) $(EXTRA_OBJS) \ $(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP) diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index 8cb3d5a32c..350d04fd71 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -325,7 +325,7 @@ define LINK_ALLSYMS $(if $(CONFIG_HOST_MACOS), \ $(Q) $(TOPDIR)/tools/mkallsyms.sh noconst $(NUTTX) $(CROSSDEV) > allsyms.tmp, \ $(Q) $(TOPDIR)/tools/mkallsyms.py $(NUTTX) allsyms.tmp) - $(Q) $(call COMPILE, -x c allsyms.tmp, allsyms$(OBJEXT)) + $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c) $(if $(CONFIG_HAVE_CXX),\ $(Q) "$(CXX)" $(CFLAGS) $(LDFLAGS) -o $(NUTTX) \ $(HEADOBJ) nuttx.rel $(HOSTOBJS) $(STDLIBS) allsyms$(OBJEXT),\ diff --git a/arch/xtensa/src/Makefile b/arch/xtensa/src/Makefile index 02510d8509..132475b146 100644 --- a/arch/xtensa/src/Makefile +++ b/arch/xtensa/src/Makefile @@ -150,7 +150,7 @@ board/libboard$(LIBEXT): define LINK_ALLSYMS $(Q) $(TOPDIR)/tools/mkallsyms.py $(NUTTX) allsyms.tmp - $(Q) $(call COMPILE, -x c allsyms.tmp, allsyms$(OBJEXT)) + $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c) $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \ -o $(NUTTX) $(STARTUP_OBJS) allsyms$(OBJEXT) $(EXTRA_OBJS) \ $(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP) diff --git a/tools/Config.mk b/tools/Config.mk index 5e7155b3ed..c22ff5d0e2 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -272,7 +272,7 @@ define PREPROCESS endef # COMPILE - Default macro to compile one C file -# Example: $(call COMPILE, in-file, out-file) +# Example: $(call COMPILE, in-file, out-file, flags) # # Depends on these settings defined in board-specific Make.defs file # installed at $(TOPDIR)/Make.defs: @@ -285,11 +285,11 @@ endef define COMPILE @echo "CC: $1" - $(Q) $(CCACHE) $(CC) -c $(CFLAGS) $($(strip $1)_CFLAGS) $1 -o $2 + $(Q) $(CCACHE) $(CC) -c $(CFLAGS) $3 $($(strip $1)_CFLAGS) $1 -o $2 endef # COMPILEXX - Default macro to compile one C++ file -# Example: $(call COMPILEXX, in-file, out-file) +# Example: $(call COMPILEXX, in-file, out-file, flags) # # Depends on these settings defined in board-specific Make.defs file # installed at $(TOPDIR)/Make.defs: @@ -303,7 +303,7 @@ endef define COMPILEXX @echo "CXX: $1" - $(Q) $(CCACHE) $(CXX) -c $(CXXFLAGS) $($(strip $1)_CXXFLAGS) $1 -o $2 + $(Q) $(CCACHE) $(CXX) -c $(CXXFLAGS) $3 $($(strip $1)_CXXFLAGS) $1 -o $2 endef # COMPILERUST - Default macro to compile one Rust file