From 7625a8b6926e990b6715cb2e3d74c9bc83201871 Mon Sep 17 00:00:00 2001 From: simbit18 <101105604+simbit18@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:26:15 +0200 Subject: [PATCH] CURLSTORE --- tools/Config.mk | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/Config.mk b/tools/Config.mk index c06b256e3ad7e..d2de4fe829b31 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -620,6 +620,25 @@ define DOWNLOAD $(ECHO_END) endef +# CURLSTORE - Download file. The URL base is joined with TARBALL by '/' and +# downloaded to the TARBALL file. +# The third argument is an output path. The second argument is used +# if it is not provided or is empty. +# Example: $(call CURLSTORE,$(FOO_URL_BASE),$(FOO_TARBALL),foo.out,store.out) + +define CURLSTORE + echo "Downloading: $(if $4,$4,$3) " + if [ -z $4 ]; then \ + curl -L -Ss $1/$2 -o $3/$2; \ + else \ + if [ ! -f $4/$2 ]; then \ + curl -L -Ss $1/$2 -o $4/$2; \ + fi; \ + echo "Copy the file from $4 to $3"; \ + cp -f $4/$2 $3/$2; \ + fi +endef + # CLONE - Git clone repository. Initializes a new Git repository in the # folder on your local machine and populates it with the contents # of the central repository.