mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 06:33:31 +00:00
801c4aa72f
Fixes #5015
47 lines
1.0 KiB
Makefile
Executable File
47 lines
1.0 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
#
|
|
# \brief Download packages
|
|
# \author Norman Feske
|
|
# \date 2017-03-23
|
|
#
|
|
|
|
define HELP_MESSAGE
|
|
|
|
Download, verify, and uncompress depot content
|
|
|
|
usage:
|
|
|
|
$(firstword $(MAKEFILE_LIST)) <archive-path> {PUBLIC=<public>} {DBG=1}
|
|
|
|
With the optional 'DBG=1' argument, 'dbg' archives are downloaded
|
|
in addition to the corresponding 'bin' archives.
|
|
|
|
endef
|
|
|
|
export GENODE_DIR := $(realpath $(dir $(MAKEFILE_LIST))/../..)
|
|
|
|
PUBLIC_DIR ?= $(GENODE_DIR)/public
|
|
DEPOT_TOOL_DIR ?= $(GENODE_DIR)/tool/depot
|
|
|
|
include $(DEPOT_TOOL_DIR)/mk/front_end.inc
|
|
|
|
# sanitize arguments
|
|
ARGS := $(subst ..,__,$(MAKECMDGOALS))
|
|
|
|
DEPENDENCIES_CMD = $(DEPOT_TOOL_DIR)/dependencies $(ARGS)
|
|
DOWNLOAD_CMD = $(DEPOT_TOOL_DIR)/mk/downloader VERBOSE=$(VERBOSE)
|
|
|
|
.PHONY: download
|
|
download:
|
|
$(VERBOSE)\
|
|
while true; do \
|
|
if $(DEPENDENCIES_CMD) > /dev/null 2> /dev/null; then break; fi; \
|
|
missing_deps=`$(MAKE) -f $(DEPENDENCIES_CMD) 2> /dev/null | sed -n "/^ /s/ *//p"`; \
|
|
$(DOWNLOAD_CMD) $$missing_deps || break; \
|
|
done;
|
|
|
|
$(MAKECMDGOALS): download
|
|
@true
|
|
|