From 4c8bfceec4097c580b988c12d043a6cfa70f263c Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 20 Jun 2017 14:01:10 +0200 Subject: [PATCH] depot/create: build only if binaries are specified This patch makes the build step of the create tool conditional. If merely creating api, src, pkg, or raw archives, the invocation of the 'build' tool can be skipped. Otherwise, the heap message for the 'build' tool is displayed (because it is called w/o any arguments), which is misleading to the user. --- tool/depot/create | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tool/depot/create b/tool/depot/create index 3bcefba24..003435eed 100755 --- a/tool/depot/create +++ b/tool/depot/create @@ -42,6 +42,7 @@ extract: VERBOSE=$(VERBOSE) FORCE=$(FORCE) \ UPDATE_VERSIONS=$(UPDATE_VERSIONS) \ +$(MAKECMDGOALS): extract _versioned_src_of_bin = $1-$(call recipe_version,src/$(call bin_archive_recipe,$1)) _versioned_pkg = $1-$(call recipe_version,pkg/$(call bin_archive_recipe,$1)) @@ -49,12 +50,14 @@ _versioned_pkg = $1-$(call recipe_version,pkg/$(call bin_archive_recipe,$ versioned_archive = $(if $(call archive_has_type,$1,bin),$(call _versioned_src_of_bin,$1),\ $(if $(call archive_has_type,$1,pkg),$(call _versioned_pkg,$1))) -build: extract - $(VERBOSE)$(MAKE) -f $(GENODE_DIR)/tool/depot/build \ - $(foreach A,$(MAKECMDGOALS),$(call versioned_archive,$A))\ - VERBOSE=$(VERBOSE) FORCE=$(FORCE) \ - KEEP_BUILD_DIR=$(KEEP_BUILD_DIR) +# to be used within a rule body only (when the 'extract' rule has completed) +VERSIONED_ARCHIVES = $(strip $(foreach A,$(MAKECMDGOALS),$(call versioned_archive,$A))) +build: extract + $(if $(VERSIONED_ARCHIVES),\ + $(VERBOSE)$(MAKE) -f $(GENODE_DIR)/tool/depot/build $(VERSIONED_ARCHIVES) \ + VERBOSE=$(VERBOSE) FORCE=$(FORCE) \ + KEEP_BUILD_DIR=$(KEEP_BUILD_DIR)) $(MAKECMDGOALS): build @true