xuxin930 commented on code in PR #1979:
URL: https://github.com/apache/nuttx-apps/pull/1979#discussion_r1301483386
##########
Application.mk:
##########
@@ -196,38 +225,28 @@ $(MAINCOBJ): %.c$(SUFFIX)$(OBJEXT): %.c
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
-PROGLIST := $(wordlist 1,$(words $(MAINCOBJ) $(MAINCXXOBJ)
$(MAINRUSTOBJ)),$(PROGNAME))
-PROGLIST := $(addprefix $(BINDIR)$(DELIM),$(PROGLIST))
-PROGOBJ := $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ)
-
$(PROGLIST): $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ)
$(Q) mkdir -p $(BINDIR)
- $(call ELFLD,$(firstword $(PROGOBJ)),$(call CONVERT_PATH,$(firstword
$(PROGLIST))))
- $(Q) chmod +x $(firstword $(PROGLIST))
+ $(call ELFLD,$(ELFPROGKEY_$@),$(call CONVERT_PATH,$@))
+ $(Q) chmod +x $@
ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
- $(Q) $(STRIP) $(firstword $(PROGLIST))
+ $(Q) $(STRIP) $@
endif
- $(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST)))
- $(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ)))
install:: $(PROGLIST)
@:
else
-MAINNAME := $(addsuffix _main,$(PROGNAME))
-
$(MAINCXXOBJ): %$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
- $(eval MAIN=$(word $(call GETINDEX,$<,$(MAINCXXSRCS)),$(MAINNAME)))
- $(eval $<_CXXFLAGS += ${DEFINE_PREFIX}main=$(MAIN))
- $(eval $<_CXXELFFLAGS += ${DEFINE_PREFIX}main=$(MAIN))
+ $(eval $<_CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(addsuffix
_main, $(strip $(PROGKEY_$@)))})
+ $(eval $<_CXXELFFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(addsuffix
_main, $(strip $(PROGKEY_$@)))})
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
$(MAINCOBJ): %.c$(SUFFIX)$(OBJEXT): %.c
- $(eval MAIN=$(word $(call GETINDEX,$<,$(MAINCSRCS)),$(MAINNAME)))
Review Comment:
> let's apply the same change to:
https://github.com/apache/nuttx-apps/blob/master/tools/Wasm.mk#L148 and remove
GETINDEX frrom Make.defs
WIP
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]