Skip to content

Commit

Permalink
build depend:Revert Make.dep intermediate ddc file
Browse files Browse the repository at this point in the history
Revert "Parallelize depend file generation"
This reverts commit d5b6ec4.

parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly

Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 committed Sep 14, 2024
1 parent 401a06f commit 253c2d3
Show file tree
Hide file tree
Showing 37 changed files with 64 additions and 214 deletions.
7 changes: 2 additions & 5 deletions arch/arm/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,12 @@ endif

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip$(DELIM)Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, ,$(VPATH)))"
$(Q) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/arm64/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,12 @@ endif

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip$(DELIM)Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, ,$(VPATH)))"
$(Q) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/avr/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,12 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR)"
$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/hc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,12 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR)"
$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/mips/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,12 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR)"
$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/misoc/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,12 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR)"
$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/or1k/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,12 @@ endif

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip$(DELIM)Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, ,$(VPATH)))"
$(Q) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
6 changes: 1 addition & 5 deletions arch/renesas/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,11 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common"
$(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/risc-v/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,12 @@ endif

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, ,$(VPATH)))"
$(Q) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) > Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/sim/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,6 @@ export_startup: sim_head.o $(HOSTOBJS) nuttx-names.dat

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HOSTSRCS:.c=.ddh)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

config.h: $(TOPDIR)/include/nuttx/config.h
@echo "CP: $<"
$(Q) cp $< $@
Expand All @@ -465,7 +461,8 @@ config.h: $(TOPDIR)/include/nuttx/config.h
$(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board depend ; \
fi
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(ASRCS) $(CSRCS) >Make.dep
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(HOSTCFLAGS) -- $(HOSTSRCS) >>Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/tricore/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,12 @@ endif

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip$(DELIM)Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, ,$(VPATH)))"
$(Q) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/x86/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,12 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR)"
$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/x86_64/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,12 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR)"
$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
7 changes: 2 additions & 5 deletions arch/xtensa/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,12 @@ export_startup: $(STARTUP_OBJS)

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HEAD_CSRC:.c=.ddc) $(HEAD_ASRC:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile chip/Make.defs $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board depend
endif
$(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, ,$(VPATH)))"
$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
6 changes: 1 addition & 5 deletions audio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
6 changes: 1 addition & 5 deletions binfmt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,8 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
11 changes: 6 additions & 5 deletions boards/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ $(CXXOBJS): %$(OBJEXT): %.cxx
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(CXXSRCS:.cxx=.ddx)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile
ifneq ($(SRCS),)
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
endif
ifneq ($(CXXSRCS),)
$(Q) $(MKDEP) "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >>Make.dep
endif
$(Q) touch $@

depend: .depend
Expand Down
6 changes: 1 addition & 5 deletions crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,9 @@ $(COBJS): %$(OBJEXT): %.c
$(BIN): $(OBJS)
$(call ARCHIVE, $@, $(OBJS))

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
ifeq ($(CONFIG_CRYPTO),y)
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
endif
$(Q) touch $@

Expand Down
6 changes: 1 addition & 5 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,8 @@ $(BIN): $(OBJS)

context::

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
6 changes: 1 addition & 5 deletions fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,8 @@ $(BIN): $(OBJS)

context::

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
6 changes: 1 addition & 5 deletions graphics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,8 @@ $(BIN): $(OBJS)

mklibgraphics: $(BIN)

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: gensources Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
12 changes: 2 additions & 10 deletions libs/libc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,10 @@ endif

# Dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, bin/Make.dep, $^)
$(call DELFILE, $^)

makekdepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, kbin/Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile OBJPATH="bin"
$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep
ifneq ($(CONFIG_BUILD_FLAT),y)
$(Q) $(MAKE) makekdepfile CFLAGS="$(CFLAGS) $(KDEFINE)" OBJPATH="kbin"
$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep
endif
ifeq ($(CONFIG_LIBC_ZONEINFO_ROMFS),y)
$(Q) $(MAKE) -C zoneinfo depend BIN=$(BIN)
Expand Down
6 changes: 1 addition & 5 deletions libs/libc/zoneinfo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,8 @@ context: .tzbuilt romfs

# Create dependencies

makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
$(call CATFILE, Make.dep, $^)
$(call DELFILE, $^)

.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
$(Q) $(MAKE) makedepfile
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@

depend: .depend
Expand Down
Loading

0 comments on commit 253c2d3

Please sign in to comment.