This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new d5b6ec4  Parallelize depend file generation
d5b6ec4 is described below

commit d5b6ec450fde069a4e64569b0eb7e4fcb3b96e83
Author: Matias N <mat...@protobits.dev>
AuthorDate: Wed Nov 18 13:44:58 2020 -0300

    Parallelize depend file generation
---
 arch/arm/src/Makefile       |  7 +++++--
 arch/avr/src/Makefile       |  7 +++++--
 arch/hc/src/Makefile        |  7 +++++--
 arch/mips/src/Makefile      |  7 +++++--
 arch/misoc/src/Makefile     |  7 +++++--
 arch/or1k/src/Makefile      |  7 +++++--
 arch/renesas/src/Makefile   |  6 +++++-
 arch/risc-v/src/Makefile    |  7 +++++--
 arch/sim/src/Makefile       |  7 +++++--
 arch/x86/src/Makefile       |  7 +++++--
 arch/x86_64/src/Makefile    |  7 +++++--
 arch/xtensa/src/Makefile    |  7 +++++--
 audio/Makefile              |  6 +++++-
 binfmt/Makefile             |  6 +++++-
 boards/Makefile             | 11 +++++------
 crypto/Makefile             |  6 +++++-
 drivers/Makefile            |  6 +++++-
 fs/Makefile                 |  6 +++++-
 graphics/Makefile           |  6 +++++-
 libs/libc/Makefile          | 12 ++++++++++--
 libs/libc/bin/Makefile      |  2 +-
 libs/libc/zoneinfo/Makefile |  6 +++++-
 libs/libdsp/Makefile        |  6 +++++-
 libs/libnx/Makefile         | 12 ++++++++++--
 libs/libnx/kbin/Makefile    |  2 +-
 libs/libxx/Makefile         |  6 +++++-
 mm/Makefile                 | 12 ++++++++++--
 net/Makefile                |  6 +++++-
 openamp/Makefile            |  6 +++++-
 pass1/Makefile              |  6 +++++-
 sched/Makefile              |  6 +++++-
 syscall/Makefile            |  7 +++++--
 tools/Config.mk             | 17 +++++++++++++++++
 video/Makefile              |  6 +++++-
 wireless/Makefile           |  6 +++++-
 35 files changed, 194 insertions(+), 54 deletions(-)

diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile
index 5224cac..6477156 100644
--- a/arch/arm/src/Makefile
+++ b/arch/arm/src/Makefile
@@ -194,12 +194,15 @@ 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) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, 
,$(VPATH)))"
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/avr/src/Makefile b/arch/avr/src/Makefile
index 29bbd9f..e91f0da 100644
--- a/arch/avr/src/Makefile
+++ b/arch/avr/src/Makefile
@@ -140,12 +140,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common --dep-path 
$(ARCH_SUBDIR) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common 
--dep-path $(ARCH_SUBDIR)"
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/hc/src/Makefile b/arch/hc/src/Makefile
index b521aa5..e0d5331 100644
--- a/arch/hc/src/Makefile
+++ b/arch/hc/src/Makefile
@@ -155,12 +155,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common --dep-path 
$(ARCH_SUBDIR) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common 
--dep-path $(ARCH_SUBDIR)"
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/mips/src/Makefile b/arch/mips/src/Makefile
index bc2c19d..cdbd2a8 100644
--- a/arch/mips/src/Makefile
+++ b/arch/mips/src/Makefile
@@ -138,12 +138,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common --dep-path 
$(ARCH_SUBDIR) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common 
--dep-path $(ARCH_SUBDIR)"  
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/misoc/src/Makefile b/arch/misoc/src/Makefile
index 2fd406e..d6e2eb5 100644
--- a/arch/misoc/src/Makefile
+++ b/arch/misoc/src/Makefile
@@ -141,12 +141,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common --dep-path 
$(ARCH_SUBDIR) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common 
--dep-path $(ARCH_SUBDIR)"  
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/or1k/src/Makefile b/arch/or1k/src/Makefile
index 7b1a552..93b6f2e 100644
--- a/arch/or1k/src/Makefile
+++ b/arch/or1k/src/Makefile
@@ -181,12 +181,15 @@ 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) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, 
,$(VPATH)))"
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/renesas/src/Makefile b/arch/renesas/src/Makefile
index c5566a5..8c62b8d 100644
--- a/arch/renesas/src/Makefile
+++ b/arch/renesas/src/Makefile
@@ -149,11 +149,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- 
$(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common"    
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/risc-v/src/Makefile b/arch/risc-v/src/Makefile
index 5eb527e..caa9147 100644
--- a/arch/risc-v/src/Makefile
+++ b/arch/risc-v/src/Makefile
@@ -184,12 +184,15 @@ endif
 
 # Dependencies
 
+makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
+       $(call CATFILE, Make.dep, $^)
+       $(call DELFILE, $^)
+
 .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
 ifeq ($(BOARDMAKE),y)
        $(Q) $(MAKE) -C board depend
 endif
-       $(Q) $(MKDEP) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) > Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="$(patsubst %,--dep-path %,$(subst :, 
,$(VPATH)))"
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile
index af0f228..611f09a 100644
--- a/arch/sim/src/Makefile
+++ b/arch/sim/src/Makefile
@@ -330,12 +330,15 @@ export_startup: board/libboard$(LIBEXT) up_head.o 
$(HOSTOBJS) nuttx-names.dat
 
 # Dependencies
 
+makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HOSTSRCS:.c=.ddh)
+       $(call CATFILE, Make.dep, $^)
+       $(call DELFILE, $^)
+
 .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
        $(Q) if [ -e board/Makefile ]; then \
                $(MAKE) -C board depend ; \
        fi
-       $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(ASRCS) $(CSRCS) 
>Make.dep
-       $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(HOSTCFLAGS) -- $(HOSTSRCS) 
>>Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/x86/src/Makefile b/arch/x86/src/Makefile
index 3dc110f..fa2cfd3 100644
--- a/arch/x86/src/Makefile
+++ b/arch/x86/src/Makefile
@@ -153,12 +153,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common --dep-path 
$(ARCH_SUBDIR) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common 
--dep-path $(ARCH_SUBDIR)"  
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/x86_64/src/Makefile b/arch/x86_64/src/Makefile
index f4aab34..dac9743 100644
--- a/arch/x86_64/src/Makefile
+++ b/arch/x86_64/src/Makefile
@@ -148,12 +148,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common --dep-path 
$(ARCH_SUBDIR) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common 
--dep-path $(ARCH_SUBDIR)"  
        $(Q) touch $@
 
 depend: .depend
diff --git a/arch/xtensa/src/Makefile b/arch/xtensa/src/Makefile
index ad0e4fa..31a4544 100644
--- a/arch/xtensa/src/Makefile
+++ b/arch/xtensa/src/Makefile
@@ -139,12 +139,15 @@ export_startup: board/libboard$(LIBEXT) $(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) $(MKDEP) --dep-path chip --dep-path common --dep-path 
$(ARCH_SUBDIR) \
-        "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="--dep-path chip --dep-path common 
--dep-path $(ARCH_SUBDIR)"  
        $(Q) touch $@
 
 depend: .depend
diff --git a/audio/Makefile b/audio/Makefile
index 9fcabcd..a8c7829 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -68,9 +68,13 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/binfmt/Makefile b/binfmt/Makefile
index 23dcdab..fd52995 100644
--- a/binfmt/Makefile
+++ b/binfmt/Makefile
@@ -80,9 +80,13 @@ $(BINFMT_COBJS): %$(OBJEXT): %.c
 
 $(BIN): $(BINFMT_OBJS)
        $(call ARCHIVE, $@, $(BINFMT_OBJS))
+  
+makedepfile: $(BINFMT_CSRCS:.c=.ddc) $(BINFMT_ASRCS:.S=.dds)
+       $(call CATFILE, Make.dep, $^)
+       $(call DELFILE, $^)
 
 .depend: Makefile $(BINFMT_SRCS) $(TOPDIR)$(DELIM).config
-       $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(BINFMT_SRCS) 
>Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/boards/Makefile b/boards/Makefile
index c6a7c92..8169ebd 100644
--- a/boards/Makefile
+++ b/boards/Makefile
@@ -98,14 +98,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
-ifneq ($(SRCS),)
-       $(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
-endif
-ifneq ($(CXXSRCS),)
-       $(Q) $(MKDEP) "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >>Make.dep
-endif
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/crypto/Makefile b/crypto/Makefile
index fd663fe..68eb31a 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -89,10 +89,14 @@ $(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) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
 endif
        $(Q) touch $@
 
diff --git a/drivers/Makefile b/drivers/Makefile
index d8d1a76..1c1139d 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -119,9 +119,13 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/fs/Makefile b/fs/Makefile
index 786c949..6d7717a 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -97,9 +97,13 @@ $(BIN):      $(OBJS)
        $(call ARCHIVE, $@, $(OBJS))
 
 context::
+  
+makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
+       $(call CATFILE, Make.dep, $^)
+       $(call DELFILE, $^)
 
 .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
-       $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/graphics/Makefile b/graphics/Makefile
index 9a733be..5eda6b4 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -124,8 +124,12 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/libs/libc/Makefile b/libs/libc/Makefile
index 572ec22..8371b11 100644
--- a/libs/libc/Makefile
+++ b/libs/libc/Makefile
@@ -156,10 +156,18 @@ 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) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" 
-- $(CFLAGS) -- $(SRCS) >bin/Make.dep
+       $(Q) $(MAKE) makedepfile
 ifneq ($(CONFIG_BUILD_FLAT),y)
-       $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" 
-- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep
+       $(Q) $(MAKE) makekdepfile CFLAGS="$(CFLAGS) $(KDEFINE)"
 endif
 ifeq ($(CONFIG_LIB_ZONEINFO_ROMFS),y)
        $(Q) $(MAKE) -C zoneinfo depend BIN=$(BIN)
diff --git a/libs/libc/bin/Makefile b/libs/libc/bin/Makefile
index ffccef3..dedc963 100644
--- a/libs/libc/bin/Makefile
+++ b/libs/libc/bin/Makefile
@@ -37,7 +37,7 @@ include $(TOPDIR)/Make.defs
 
 all:
 .PHONY: clean distclean
-
+  
 # Clean Targets:
 
 clean:
diff --git a/libs/libc/zoneinfo/Makefile b/libs/libc/zoneinfo/Makefile
index d6e6636..44e3df0 100644
--- a/libs/libc/zoneinfo/Makefile
+++ b/libs/libc/zoneinfo/Makefile
@@ -118,8 +118,12 @@ 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) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/libs/libdsp/Makefile b/libs/libdsp/Makefile
index bc3be54..6d1ed1a 100644
--- a/libs/libdsp/Makefile
+++ b/libs/libdsp/Makefile
@@ -49,9 +49,13 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/libs/libnx/Makefile b/libs/libnx/Makefile
index 86ef567..2408eee 100644
--- a/libs/libnx/Makefile
+++ b/libs/libnx/Makefile
@@ -235,10 +235,18 @@ 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 gensources $(SRCS) $(TOPDIR)$(DELIM).config
-       $(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" 
-- $(CFLAGS) -- $(SRCS) >bin/Make.dep
+       $(Q) $(MAKE) makedepfile
 ifneq ($(CONFIG_BUILD_FLAT),y)
-       $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" 
-- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep
+       $(Q) $(MAKE) makekdepfile CFLAGS="$(CFLAGS) $(KDEFINE)"
 endif
        $(Q) touch $@
 
diff --git a/libs/libnx/kbin/Makefile b/libs/libnx/kbin/Makefile
index e347523..dd4e30e 100644
--- a/libs/libnx/kbin/Makefile
+++ b/libs/libnx/kbin/Makefile
@@ -37,7 +37,7 @@ include $(TOPDIR)/Make.defs
 
 all:
 .PHONY: clean distclean
-
+  
 # Clean Targets:
 
 clean:
diff --git a/libs/libxx/Makefile b/libs/libxx/Makefile
index 87cf196..6c787fe 100644
--- a/libs/libxx/Makefile
+++ b/libs/libxx/Makefile
@@ -91,8 +91,12 @@ $(BIN):      $(OBJS)
 
 dirlinks::
 
+makedepfile: $(CXXSRCS:.cxx=.ddx) $(CPPSRCS:.cpp=.ddp)
+       $(call CATFILE, Make.dep, $^)
+       $(call DELFILE, $^)
+
 .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
-       $(Q) $(MKDEP) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/mm/Makefile b/mm/Makefile
index ae04d19..a2b6cb5 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -82,10 +82,18 @@ 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) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" 
-- $(CFLAGS) -- $(SRCS) >bin/Make.dep
+       $(Q) $(MAKE) makedepfile 
 ifneq ($(CONFIG_BUILD_FLAT),y)
-       $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" 
-- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep
+       $(Q) $(MAKE) makekdepfile CFLAGS="$(CFLAGS) $(KDEFINE)"
 endif
        $(Q) touch $@
 
diff --git a/net/Makefile b/net/Makefile
index db40ad6..7cf01a1 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -91,10 +91,14 @@ $(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_NET),y)
-       $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
 endif
        $(Q) touch $@
 
diff --git a/openamp/Makefile b/openamp/Makefile
index d9e9eb3..100baad 100644
--- a/openamp/Makefile
+++ b/openamp/Makefile
@@ -47,8 +47,12 @@ $(BIN): $(OBJS)
 
 dirlinks::
 
+makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
+       $(call CATFILE, Make.dep, $^)
+       $(call DELFILE, $^)
+
 .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
-       $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/pass1/Makefile b/pass1/Makefile
index 27704f6..d9a9029 100644
--- a/pass1/Makefile
+++ b/pass1/Makefile
@@ -57,9 +57,13 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/sched/Makefile b/sched/Makefile
index 2ac0743..fb3bd8d 100644
--- a/sched/Makefile
+++ b/sched/Makefile
@@ -58,9 +58,13 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/syscall/Makefile b/syscall/Makefile
index 9ad30b6..3d94e7c 100644
--- a/syscall/Makefile
+++ b/syscall/Makefile
@@ -93,9 +93,12 @@ $(BIN3): $(WRAP_OBJS)
 
 $(SYSCALLWRAPS): .context
 
+makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
+       $(call CATFILE, Make.dep, $^)
+       $(call DELFILE, $^)
+
 .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
-       $(Q) $(MKDEP) $(PROXYDEPPATH) $(STUBDEPPATH) $(WRAPDEPPATH) \
-         "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile DEPPATH="$(PROXYDEPPATH) $(STUBDEPPATH) 
$(WRAPDEPPATH)"
        $(Q) touch $@
 
 depend: .depend
diff --git a/tools/Config.mk b/tools/Config.mk
index b3626b5..0e2aac9 100644
--- a/tools/Config.mk
+++ b/tools/Config.mk
@@ -200,6 +200,23 @@ else
   MKDEP ?= $(TOPDIR)$(DELIM)tools$(DELIM)mkdeps$(HOSTEXEEXT)
 endif
 
+# Per-file dependency generation rules
+
+%.dds: %.S
+       $(Q) $(MKDEP) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- 
$< > $@
+
+%.ddc: %.c
+       $(Q) $(MKDEP) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- 
$< > $@
+
+%.ddp: %.cpp
+       $(Q) $(MKDEP) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) 
-- $< > $@
+
+%.ddx: %.cxx
+       $(Q) $(MKDEP) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) 
-- $< > $@
+
+%.ddh: %.c
+       $(Q) $(MKDEP) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- 
$(HOSTCFLAGS) -- $< > $@
+
 # INCDIR - Convert a list of directory paths to a list of compiler include
 #   directories
 # Example: CFFLAGS += ${shell $(INCDIR) [options] "compiler" "dir1" "dir2" 
"dir2" ...}
diff --git a/video/Makefile b/video/Makefile
index 92492d3..8775229 100644
--- a/video/Makefile
+++ b/video/Makefile
@@ -55,9 +55,13 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend
diff --git a/wireless/Makefile b/wireless/Makefile
index edd9082..b2c46fa 100644
--- a/wireless/Makefile
+++ b/wireless/Makefile
@@ -60,9 +60,13 @@ $(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) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
+       $(Q) $(MAKE) makedepfile
        $(Q) touch $@
 
 depend: .depend

Reply via email to