tools: add separate flags parameter for COMPILE/COMPILEXX

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-01-30 15:20:55 +08:00 committed by Xiang Xiao
parent 74e032e924
commit 3f97a87162
6 changed files with 9 additions and 9 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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),\

View File

@ -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)

View File

@ -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