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.
This commit is contained in:
Norman Feske 2017-06-20 14:01:10 +02:00
parent 04f82721b1
commit 4c8bfceec4
1 changed files with 8 additions and 5 deletions

View File

@ -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