2017-03-28 16:41:41 +00:00
|
|
|
#!/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>}
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
export GENODE_DIR := $(realpath $(dir $(MAKEFILE_LIST))/../..)
|
|
|
|
|
2022-05-17 12:17:01 +00:00
|
|
|
PUBLIC_DIR ?= $(GENODE_DIR)/public
|
|
|
|
DEPOT_TOOL_DIR ?= $(GENODE_DIR)/tool/depot
|
2017-03-28 16:41:41 +00:00
|
|
|
|
2022-05-17 12:17:01 +00:00
|
|
|
include $(DEPOT_TOOL_DIR)/mk/front_end.inc
|
2017-03-28 16:41:41 +00:00
|
|
|
|
|
|
|
# sanitize arguments
|
|
|
|
ARGS := $(subst ..,__,$(MAKECMDGOALS))
|
|
|
|
|
2022-05-17 12:17:01 +00:00
|
|
|
DEPENDENCIES_CMD = $(DEPOT_TOOL_DIR)/dependencies $(ARGS)
|
|
|
|
DOWNLOAD_CMD = $(DEPOT_TOOL_DIR)/mk/downloader VERBOSE=$(VERBOSE)
|
2017-03-28 16:41:41 +00:00
|
|
|
|
|
|
|
.PHONY: download
|
|
|
|
download:
|
|
|
|
$(VERBOSE)\
|
|
|
|
while true; do \
|
|
|
|
if $(DEPENDENCIES_CMD) > /dev/null 2> /dev/null; then break; fi; \
|
|
|
|
missing_deps=`$(DEPENDENCIES_CMD) 2> /dev/null | sed -n "/^ /s/ *//p"`; \
|
|
|
|
$(DOWNLOAD_CMD) $$missing_deps || break; \
|
|
|
|
done;
|
|
|
|
|
|
|
|
$(MAKECMDGOALS): download
|
|
|
|
@true
|
|
|
|
|