From 223d8a12d54fec4a17bcb175ef8ed95b965047fc Mon Sep 17 00:00:00 2001 From: hgy59 Date: Sat, 2 Jan 2021 13:53:42 +0100 Subject: [PATCH] fix dependency targets - fix dependency-list and dependency-tree targets for make errors - introduce DEPENDENCY_WALK=1 and skip error reporting in make file for meson builds --- mk/spksrc.cross-meson-env.mk | 13 ++++++++----- mk/spksrc.dependency-tree.mk | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/mk/spksrc.cross-meson-env.mk b/mk/spksrc.cross-meson-env.mk index 1071722043e..c49b44be154 100644 --- a/mk/spksrc.cross-meson-env.mk +++ b/mk/spksrc.cross-meson-env.mk @@ -34,11 +34,14 @@ ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) MESON_CFG_FILE = x86_64.cfg endif -ifeq ($(strip $(MESON_CFG_FILE)),) - $(warning No meson config file defined for $(ARCH)) -else - ifeq ($(wildcard $(MESON_CFG_DIR)/$(MESON_CFG_FILE)),) - $(warning meson config file not found: $(MESON_CFG_DIR)/$(MESON_CFG_FILE)) +# disable error handling for target dependency-list +ifneq ($(strip $(DEPENDENCY_WALK)),1) + ifeq ($(strip $(MESON_CFG_FILE)),) + $(error No meson config file defined for $(ARCH)) + else + ifeq ($(wildcard $(MESON_CFG_DIR)/$(MESON_CFG_FILE)),) + $(error meson config file not found: $(MESON_CFG_DIR)/$(MESON_CFG_FILE)) + endif endif endif diff --git a/mk/spksrc.dependency-tree.mk b/mk/spksrc.dependency-tree.mk index 70387599a7f..7781f44cb2c 100644 --- a/mk/spksrc.dependency-tree.mk +++ b/mk/spksrc.dependency-tree.mk @@ -8,14 +8,24 @@ ### the list is sorted and does not include duplicate dependencies. ### sample: ### minio: cross/busybox cross/minio native/go native/go-1.4 - +### +### NOTES: +### o Packages with conditional dependencies must define such dependencies +### additionally with OPTIONAL_DEPENDS, otherwise not all dependencies are found. +### +### o dependency-tree and dependency-list call make for all dependencies without +### the definition of specific ARCH nor TCVERSION. +### Therefore every Makefile (including mk/*.mk) must not abort nor put +### output with error, warning or info directive when the variable +### DEPENDENCY_WALK is set to 1. +### .PHONY: dependency-tree dependency-tree: @echo `perl -e 'print "\\\t" x $(MAKELEVEL),"\n"'`+ $(NAME) $(PKG_VERS) @for depend in $(BUILD_DEPENDS) $(DEPENDS) $(OPTIONAL_DEPENDS) ; \ do \ - $(MAKE) -s -C ../../$$depend dependency-tree ; \ + DEPENDENCY_WALK=1 $(MAKE) -s -C ../../$$depend dependency-tree ; \ done @@ -30,5 +40,5 @@ dependency-flat: @echo "$(CURDIR)" | grep -Po "/\K(spk|cross|native|diyspk)/.*" @for depend in $(BUILD_DEPENDS) $(DEPENDS) $(OPTIONAL_DEPENDS) ; \ do \ - $(MAKE) -s -C ../../$$depend dependency-flat ; \ + DEPENDENCY_WALK=1 $(MAKE) -s -C ../../$$depend dependency-flat ; \ done