diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile index becb8a00f1..b22c952f5a 100644 --- a/arch/arm/src/Makefile +++ b/arch/arm/src/Makefile @@ -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 diff --git a/arch/arm64/src/Makefile b/arch/arm64/src/Makefile index 15f5b7b02d..7b29c92918 100644 --- a/arch/arm64/src/Makefile +++ b/arch/arm64/src/Makefile @@ -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 diff --git a/arch/avr/src/Makefile b/arch/avr/src/Makefile index da50e27bee..0c0e97d9d5 100644 --- a/arch/avr/src/Makefile +++ b/arch/avr/src/Makefile @@ -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 diff --git a/arch/hc/src/Makefile b/arch/hc/src/Makefile index 607b1f7219..f3d9f0d625 100644 --- a/arch/hc/src/Makefile +++ b/arch/hc/src/Makefile @@ -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 diff --git a/arch/mips/src/Makefile b/arch/mips/src/Makefile index 722e4c272f..fe68c5c144 100644 --- a/arch/mips/src/Makefile +++ b/arch/mips/src/Makefile @@ -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 diff --git a/arch/misoc/src/Makefile b/arch/misoc/src/Makefile index 6773d6e8cd..32dac9a080 100644 --- a/arch/misoc/src/Makefile +++ b/arch/misoc/src/Makefile @@ -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 diff --git a/arch/or1k/src/Makefile b/arch/or1k/src/Makefile index 48fcd3ff5e..b58c3535f7 100644 --- a/arch/or1k/src/Makefile +++ b/arch/or1k/src/Makefile @@ -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 diff --git a/arch/renesas/src/Makefile b/arch/renesas/src/Makefile index 13cbc84940..36daca6880 100644 --- a/arch/renesas/src/Makefile +++ b/arch/renesas/src/Makefile @@ -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 diff --git a/arch/risc-v/src/Makefile b/arch/risc-v/src/Makefile index 6a057638f9..fa85e1dffb 100644 --- a/arch/risc-v/src/Makefile +++ b/arch/risc-v/src/Makefile @@ -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 diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index c3ce0a8f46..9654b12fef 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -457,10 +457,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 $< $@ @@ -469,7 +465,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 diff --git a/arch/tricore/src/Makefile b/arch/tricore/src/Makefile index 157065a574..f440fbe401 100644 --- a/arch/tricore/src/Makefile +++ b/arch/tricore/src/Makefile @@ -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 diff --git a/arch/x86/src/Makefile b/arch/x86/src/Makefile index 53e6d701b8..709eac6392 100644 --- a/arch/x86/src/Makefile +++ b/arch/x86/src/Makefile @@ -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 diff --git a/arch/x86_64/src/Makefile b/arch/x86_64/src/Makefile index 8261aea14a..5c1b63e1a6 100644 --- a/arch/x86_64/src/Makefile +++ b/arch/x86_64/src/Makefile @@ -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 diff --git a/arch/xtensa/src/Makefile b/arch/xtensa/src/Makefile index ec83edd9b8..3a986c14fe 100644 --- a/arch/xtensa/src/Makefile +++ b/arch/xtensa/src/Makefile @@ -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) $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) \ + "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ depend: .depend diff --git a/audio/Makefile b/audio/Makefile index d3b50e96f7..62ba8ca834 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -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 diff --git a/binfmt/Makefile b/binfmt/Makefile index 8916865990..973a617517 100644 --- a/binfmt/Makefile +++ b/binfmt/Makefile @@ -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 diff --git a/boards/Makefile b/boards/Makefile index cf28f17777..bde1440b16 100644 --- a/boards/Makefile +++ b/boards/Makefile @@ -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 diff --git a/crypto/Makefile b/crypto/Makefile index de41512f5e..fdce9bedd3 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -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 $@ diff --git a/drivers/Makefile b/drivers/Makefile index 1461e7f223..d6b8db7c9e 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -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 diff --git a/fs/Makefile b/fs/Makefile index 050ec8d743..8ac7841a2a 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -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 diff --git a/graphics/Makefile b/graphics/Makefile index f987e68df3..1c3d115a50 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -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 diff --git a/libs/libc/Makefile b/libs/libc/Makefile index dd5a3452dd..fa509a799a 100644 --- a/libs/libc/Makefile +++ b/libs/libc/Makefile @@ -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) diff --git a/libs/libc/zoneinfo/Makefile b/libs/libc/zoneinfo/Makefile index 0fd1c68eef..4e462a4abd 100644 --- a/libs/libc/zoneinfo/Makefile +++ b/libs/libc/zoneinfo/Makefile @@ -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 diff --git a/libs/libdsp/Makefile b/libs/libdsp/Makefile index 0d110be4c8..166db7bbde 100644 --- a/libs/libdsp/Makefile +++ b/libs/libdsp/Makefile @@ -61,12 +61,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 diff --git a/libs/libm/Makefile b/libs/libm/Makefile index ed20d5baf1..67ef0dbc56 100644 --- a/libs/libm/Makefile +++ b/libs/libm/Makefile @@ -65,18 +65,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 $(Q) touch $@ diff --git a/libs/libm/openlibm/Make.defs b/libs/libm/openlibm/Make.defs index 1494863f03..1b6c1e2ea1 100644 --- a/libs/libm/openlibm/Make.defs +++ b/libs/libm/openlibm/Make.defs @@ -89,9 +89,11 @@ endef ifneq ($(filter $(ARCH),i387 amd64),) # Add ld80 directory on x86 and x64 $(eval $(call INC_template,openlibm/openlibm/ld80)) VPATH += :openlibm/openlibm/ld80 +DEPPATH += --dep-path openlibm/openlibm/ld80 else ifneq ($(filter $(ARCH),aarch64),) # Add ld128 directory on aarch64 $(eval $(call INC_template,openlibm/openlibm/ld128)) VPATH += :openlibm/openlibm/ld128 +DEPPATH += --dep-path openlibm/openlibm/ld128 endif $(eval $(call INC_template,openlibm/openlibm/src,src)) @@ -102,6 +104,10 @@ VPATH += :openlibm/openlibm/src VPATH += :openlibm/openlibm/$(ARCH) VPATH += :openlibm/openlibm/bsdsrc +DEPPATH += --dep-path openlibm/openlibm/src +DEPPATH += --dep-path openlibm/openlibm/$(ARCH) +DEPPATH += --dep-path openlibm/openlibm/bsdsrc + CFLAGS += ${INCDIR_PREFIX}openlibm/openlibm CFLAGS += ${INCDIR_PREFIX}openlibm/openlibm/$(ARCH) CFLAGS += ${INCDIR_PREFIX}openlibm/openlibm/src diff --git a/libs/libnx/Makefile b/libs/libnx/Makefile index dd5bb2005e..a9a39e2ca0 100644 --- a/libs/libnx/Makefile +++ b/libs/libnx/Makefile @@ -220,18 +220,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 gensources $(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 $(Q) touch $@ diff --git a/libs/libxx/Makefile b/libs/libxx/Makefile index 7b5bb8ee3a..1723978699 100644 --- a/libs/libxx/Makefile +++ b/libs/libxx/Makefile @@ -76,12 +76,8 @@ $(BIN): $(OBJS) context:: -makedepfile: $(CXXSRCS:.cxx=.ddx) $(CPPSRCS:.cpp=.ddp) - $(call CATFILE, Make.dep, $^) - $(call DELFILE, $^) - .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config - $(Q) $(MAKE) makedepfile + $(Q) $(MKDEP) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ depend: .depend diff --git a/mm/Makefile b/mm/Makefile index 7ea82e21e9..1fde06fe47 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -94,18 +94,10 @@ endif context:: -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 $(Q) touch $@ diff --git a/net/Makefile b/net/Makefile index 5263eb1e62..a2949bd53f 100644 --- a/net/Makefile +++ b/net/Makefile @@ -84,13 +84,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_NET),y) - $(Q) $(MAKE) makedepfile + $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep endif $(Q) touch $@ diff --git a/openamp/Makefile b/openamp/Makefile index 8465da9ffa..8e91977a69 100644 --- a/openamp/Makefile +++ b/openamp/Makefile @@ -49,12 +49,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 diff --git a/pass1/Makefile b/pass1/Makefile index 4828bff0aa..d721a2de61 100644 --- a/pass1/Makefile +++ b/pass1/Makefile @@ -45,12 +45,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 diff --git a/sched/Makefile b/sched/Makefile index 92989e8125..9f79cd24c0 100644 --- a/sched/Makefile +++ b/sched/Makefile @@ -66,12 +66,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 diff --git a/syscall/Makefile b/syscall/Makefile index a1256018be..48f51beb5f 100644 --- a/syscall/Makefile +++ b/syscall/Makefile @@ -82,12 +82,9 @@ $(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) $(MAKE) makedepfile DEPPATH="$(PROXYDEPPATH) $(STUBDEPPATH) $(WRAPDEPPATH)" + $(Q) $(MKDEP) $(PROXYDEPPATH) $(STUBDEPPATH) $(WRAPDEPPATH) \ + "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ depend: .depend diff --git a/tools/Config.mk b/tools/Config.mk index 244157ba59..2777eb6f8c 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -221,25 +221,6 @@ else MKDEP ?= $(TOPDIR)$(DELIM)tools$(DELIM)mkdeps$(HOSTEXEEXT) endif -# Per-file dependency generation rules - -OBJPATH ?= . - -%.dds: %.S - $(Q) $(MKDEP) --obj-path $(OBJPATH) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $< > $@ - -%.ddc: %.c - $(Q) $(MKDEP) --obj-path $(OBJPATH) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $< > $@ - -%.ddp: %.cpp - $(Q) $(MKDEP) --obj-path $(OBJPATH) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $< > $@ - -%.ddx: %.cxx - $(Q) $(MKDEP) --obj-path $(OBJPATH) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $< > $@ - -%.ddh: %.c - $(Q) $(MKDEP) --obj-path $(OBJPATH) --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 a38fb52eea..a6eaba223c 100644 --- a/video/Makefile +++ b/video/Makefile @@ -43,12 +43,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 diff --git a/wireless/Makefile b/wireless/Makefile index f5dcd04793..9d1f95a597 100644 --- a/wireless/Makefile +++ b/wireless/Makefile @@ -48,12 +48,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