Application: fix multiple main target mismatch during incremental compile
MAINSRC will fail to match with PROGNAME if one of main source is changed in incremental compilation this PR will correct this issue. Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
b13f70ca59
commit
7ad9525c35
@ -203,16 +203,16 @@ else
|
|||||||
MAINNAME := $(addsuffix _main,$(PROGNAME))
|
MAINNAME := $(addsuffix _main,$(PROGNAME))
|
||||||
|
|
||||||
$(MAINCXXOBJ): %$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
|
$(MAINCXXOBJ): %$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
|
||||||
$(eval $<_CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(firstword $(MAINNAME))})
|
$(eval MAIN=$(word $(call GETINDEX,$<,$(MAINCXXSRCS)),$(MAINNAME)))
|
||||||
$(eval $<_CXXELFFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(firstword $(MAINNAME))})
|
$(eval $<_CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(MAIN)})
|
||||||
$(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
|
$(eval $<_CXXELFFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(MAIN)})
|
||||||
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
|
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
|
||||||
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
|
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
|
||||||
|
|
||||||
$(MAINCOBJ): %.c$(SUFFIX)$(OBJEXT): %.c
|
$(MAINCOBJ): %.c$(SUFFIX)$(OBJEXT): %.c
|
||||||
$(eval $<_CFLAGS += ${DEFINE_PREFIX}main=$(firstword $(MAINNAME)))
|
$(eval MAIN=$(word $(call GETINDEX,$<,$(MAINCSRCS)),$(MAINNAME)))
|
||||||
$(eval $<_CELFFLAGS += ${DEFINE_PREFIX}main=$(firstword $(MAINNAME)))
|
$(eval $<_CFLAGS += ${DEFINE_PREFIX}main=$(MAIN))
|
||||||
$(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
|
$(eval $<_CELFFLAGS += ${DEFINE_PREFIX}main=$(MAIN))
|
||||||
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
|
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
|
||||||
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
|
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user