mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
4c8bfceec4
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.
65 lines
2.1 KiB
Makefile
Executable File
65 lines
2.1 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
#
|
|
# \brief Tool for assembling API/source/binary archives
|
|
# \author Norman Feske
|
|
# \date 2017-03-16
|
|
#
|
|
|
|
define HELP_MESSAGE
|
|
|
|
Populate depot with source and binary archives based of the current
|
|
version of the Genode source tree
|
|
|
|
usage:
|
|
|
|
$(firstword $(MAKEFILE_LIST)) <archive-path>...
|
|
|
|
This tool is a front end to the 'extract' and 'build' tools.
|
|
It accepts an arbitrary number of archives without their version
|
|
suffix as arguments. Furthermore, it supports the supplemental
|
|
arguments of those tools (like VERBOSE, FORCE, -j<N>).
|
|
|
|
The 'create' tool first invokes the 'extract' tool to create the
|
|
API/source/package/raw archives needed for the specified archives.
|
|
This step is followed by the invokation of the 'build' tool with
|
|
archive arguments that match their current versions. Combined
|
|
with the 'UPDATE_VERSIONS=1' argument, it thereby allows for the
|
|
source-archive creation, version updating, and building of binary
|
|
archives via a single command.
|
|
|
|
endef
|
|
|
|
export GENODE_DIR := $(realpath $(dir $(MAKEFILE_LIST))/../..)
|
|
|
|
include $(GENODE_DIR)/tool/depot/mk/front_end.inc
|
|
|
|
|
|
.PHONY: extract build
|
|
|
|
extract:
|
|
$(VERBOSE)$(MAKE) -f $(GENODE_DIR)/tool/depot/extract $(MAKECMDGOALS) \
|
|
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))
|
|
|
|
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)))
|
|
|
|
# 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
|
|
|