diff options
Diffstat (limited to 'include/subdir.mk')
-rw-r--r-- | include/subdir.mk | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/include/subdir.mk b/include/subdir.mk index 79a80528ae..be080859b7 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -1,9 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-only # -# Copyright (C) 2007 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# +# Copyright (C) 2007-2020 OpenWrt.org ifeq ($(MAKECMDGOALS),prereq) SUBTARGETS:=prereq @@ -23,7 +20,7 @@ define subtarget endef define ERROR - ($(call MESSAGE, $(2)); $(if $(BUILD_LOG), echo "$(2)" >> $(BUILD_LOG_DIR)/$(1)/error.txt)) + ($(call MESSAGE, $(2)); $(if $(BUILD_LOG), echo "$(2)" >> $(BUILD_LOG_DIR)/$(1)/error.txt;) $(if $(3),, exit 1;)) endef lastdir=$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1))) @@ -43,6 +40,7 @@ log_make = \ $(if $(BUILD_LOG), \ set -o pipefail; \ mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \ + $(SCRIPT_DIR)/time.pl "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)" \ $$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \ $(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt) @@ -65,7 +63,7 @@ define subdir $(foreach btype,$(buildtypes-$(bd)), $(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(btype)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(btype)/$(target)) $(call $(1)//$(btype)/$(target),$(1)/$(bd)/$(btype)))) $(call log_make,$(1)/$(bd),$(target),$(btype),$(filter-out __default,$(variant))) \ - $(if $(findstring $(bd),$($(1)/builddirs-ignore-$(btype)-$(target))), || $(call ERROR,$(1), ERROR: $(1)/$(bd) [$(btype)] failed to build.)) + || $(call ERROR,$(2), ERROR: $(1)/$(bd) [$(btype)] failed to build.,$(findstring $(bd),$($(1)/builddirs-ignore-$(btype)-$(target)))) $(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(btype)/$(target): $(1)/$(bd)/$(btype)/$(target))) ) $(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd)))) @@ -73,7 +71,7 @@ define subdir $(if $(BUILD_LOG),@mkdir -p $(BUILD_LOG_DIR)/$(1)/$(bd)/$(filter-out __default,$(variant))) $(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)))) $(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant))) \ - $(if $(findstring $(bd),$($(1)/builddirs-ignore-$(target))), || $(call ERROR,$(1), ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).)) + || $(call ERROR,$(1), ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).,$(findstring $(bd),$($(1)/builddirs-ignore-$(target)))) ) $(if $(PREREQ_ONLY)$(DUMP_TARGET_DB),, # aliases |