Makefile: Fix Make.dep not updated by config changes

Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
This commit is contained in:
SPRESENSE 2020-07-22 16:54:29 +09:00 committed by Xiang Xiao
parent d560ce65ff
commit e249a2f82f
38 changed files with 38 additions and 38 deletions

View File

@ -194,7 +194,7 @@ endif
# Dependencies
.depend: Makefile chip$(DELIM)Make.defs $(SRCS)
.depend: Makefile chip$(DELIM)Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -140,7 +140,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -155,7 +155,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -138,7 +138,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -141,7 +141,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -181,7 +181,7 @@ endif
# Dependencies
.depend: Makefile chip$(DELIM)Make.defs $(SRCS)
.depend: Makefile chip$(DELIM)Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -149,7 +149,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -184,7 +184,7 @@ endif
# Dependencies
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -321,7 +321,7 @@ export_startup: board/libboard$(LIBEXT) up_head.o $(HOSTOBJS)
# Dependencies
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
fi

View File

@ -153,7 +153,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -148,7 +148,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -139,7 +139,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Dependencies
.depend: Makefile chip/Make.defs $(SRCS)
.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif

View File

@ -109,7 +109,7 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.linkcmd
@echo "LD: nuttx$(EXEEXT)"
$(Q) $(LD) $(LDFLAGS)
.depend: Makefile chip/Make.defs $(DEPSRCS)
.depend: Makefile chip/Make.defs $(DEPSRCS) $(TOPDIR)$(DELIM).config
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend )
else

View File

@ -207,7 +207,7 @@ export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS)
# Build dependencies
.depend: Makefile asm_mem.h chip/Make.defs $(DEPSRCS)
.depend: Makefile asm_mem.h chip/Make.defs $(DEPSRCS) $(TOPDIR)$(DELIM).config
$(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
fi

View File

@ -201,7 +201,7 @@ export_startup: board\libboard$(LIBEXT) $(STARTUP_OBJS)
# Build dependencies
.depend: Makefile asm_mem.h chip\Make.defs $(DEPSRCS)
.depend: Makefile asm_mem.h chip\Make.defs $(DEPSRCS) $(TOPDIR)$(DELIM).config
$(Q) if exist board\Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend )
$(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep
$(Q) touch $@

View File

@ -137,7 +137,7 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) nuttx.linkcmd
@echo "LD: nuttx$(EXEEXT)"
$(Q) "$(LD)" $(LDFLAGS)
.depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS)
.depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS) $(TOPDIR)$(DELIM).config
$(Q) if [ -e board$(DELIM)Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
fi

View File

@ -126,7 +126,7 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) nuttx.linkcmd
@echo "LD: nuttx$(EXEEXT)"
$(Q) "$(LD)" $(LDFLAGS)
.depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS)
.depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS) $(TOPDIR)$(DELIM).config
$(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend )
$(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep
$(Q) touch $@

View File

@ -69,7 +69,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -81,7 +81,7 @@ $(BINFMT_COBJS): %$(OBJEXT): %.c
$(BIN): $(BINFMT_OBJS)
$(call ARCHIVE, $@, $(BINFMT_OBJS))
.depend: Makefile $(BINFMT_SRCS)
.depend: Makefile $(BINFMT_SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(BINFMT_SRCS) >Make.dep
$(Q) touch $@

View File

@ -112,7 +112,7 @@ ifneq ($(CXXOBJS),)
$(call ARCHIVE, $@, $(CXXOBJS))
endif
.depend: Makefile $(SRCS) $(CXXSRCS) $(RCSRCS)
.depend: Makefile $(SRCS) $(CXXSRCS) $(RCSRCS) $(TOPDIR)$(DELIM).config
ifneq ($(ZDSVERSION),)
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
else

View File

@ -99,7 +99,7 @@ $(CXXOBJS): %$(OBJEXT): %.cxx
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
ifneq ($(SRCS),)
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
endif

View File

@ -90,7 +90,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(CONFIG_CRYPTO),y)
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
endif

View File

@ -118,7 +118,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -98,7 +98,7 @@ $(BIN): $(OBJS)
context::
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -124,7 +124,7 @@ $(BIN): $(OBJS)
mklibgraphics: $(BIN)
.depend: gensources Makefile $(SRCS)
.depend: gensources Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -154,7 +154,7 @@ endif
# Dependencies
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep
ifneq ($(CONFIG_BUILD_FLAT),y)
$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep

View File

@ -118,7 +118,7 @@ context: .tzbuilt romfs
# Create dependencies
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -65,7 +65,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -235,7 +235,7 @@ endif
# Dependencies
.depend: Makefile gensources $(SRCS)
.depend: Makefile gensources $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep
ifneq ($(CONFIG_BUILD_FLAT),y)
$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep

View File

@ -87,7 +87,7 @@ $(BIN): $(OBJS)
dirlinks::
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -81,7 +81,7 @@ endif
# Dependencies
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep
ifneq ($(CONFIG_BUILD_FLAT),y)
$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep

View File

@ -92,7 +92,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(CONFIG_NET),y)
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
endif

View File

@ -62,7 +62,7 @@ $(BIN): $(OBJS)
dirlinks::
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -58,7 +58,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -59,7 +59,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -93,7 +93,7 @@ $(BIN3): $(WRAP_OBJS)
$(SYSCALLWRAPS): .context
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(PROXYDEPPATH) $(STUBDEPPATH) $(WRAPDEPPATH) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -56,7 +56,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

View File

@ -61,7 +61,7 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))
.depend: Makefile $(SRCS)
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@