treewide: add DOWNLOAD variable as unification of curl call

This is a followup to the commit
03b164f59c.
This commit is contained in:
Karel Kočí 2023-03-07 17:17:54 +01:00 committed by Xiang Xiao
parent 81a4f21f1b
commit 62661600b2
20 changed files with 41 additions and 43 deletions

View file

@ -120,8 +120,7 @@ NRFXLIB_TGZ := $(NRFXLIB_REF).tar.gz
NRFXLIB_URL := https://github.com/nrfconnect/sdk-nrfxlib/archive
$(NRFXLIB_TGZ):
$(Q) echo "Downloading: NRFXLIB"
$(Q) curl -L $(NRFXLIB_URL)/$(NRFXLIB_TGZ) -o chip/$(NRFXLIB_TGZ)
$(call DOWNLOAD,$(NRFXLIB_URL),$(NRFXLIB_TGZ),chip/$(NRFXLIB_TGZ))
chip/$(NRFXLIB_UNPACK): $(NRFXLIB_TGZ)
$(Q) echo "Unpacking: NRXFLIB"

View file

@ -51,8 +51,7 @@ NRFXLIB_TGZ := $(NRFXLIB_REF).tar.gz
NRFXLIB_URL := https://github.com/nrfconnect/sdk-nrfxlib/archive
$(NRFXLIB_TGZ):
$(Q) echo "Downloading: NRFXLIB"
$(Q) curl -L $(NRFXLIB_URL)/$(NRFXLIB_TGZ) -o chip/$(NRFXLIB_TGZ)
$(call DOWNLOAD,$(NRFXLIB_URL),$(NRFXLIB_TGZ),chip/$(NRFXLIB_TGZ))
chip/$(NRFXLIB_UNPACK): $(NRFXLIB_TGZ)
$(Q) echo "Unpacking: NRXFLIB"

View file

@ -71,8 +71,7 @@ WIRELESS_DRV_ZIP = v$(WIRELESS_DRV_VERSION).zip
WIRELESS_DRV_URL = https://github.com/bouffalolab/bl_blob/archive/refs/heads
$(WIRELESS_DRV_ZIP):
$(Q) echo "Downloading: BL602 Wireless Drivers"
$(Q) curl -L $(WIRELESS_DRV_URL)/$(WIRELESS_DRV_ZIP) -o chip/$(WIRELESS_DRV_ZIP)
$(call DOWNLOAD,$(WIRELESS_DRV_URL),$(WIRELESS_DRV_ZIP),chip/$(WIRELESS_DRV_ZIP))
chip/$(WIRELESS_DRV_UNPACK): $(WIRELESS_DRV_ZIP)
$(Q) echo "Unpacking: BL602 Wireless Drivers"

View file

@ -168,8 +168,7 @@ BOOTLOADER_URL = https://github.com/espressif/esp-nuttx-bootloader/releases/
ifeq ($(CONFIG_ESP32C3_APP_FORMAT_MCUBOOT),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/mcuboot-esp32c3.bin -o $(TOPDIR)/mcuboot-esp32c3.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32c3.bin,$(TOPDIR)/mcuboot-esp32c3.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/mcuboot-esp32c3.bin)
@ -177,9 +176,8 @@ clean_bootloader:
else ifeq ($(CONFIG_ESP32C3_APP_FORMAT_LEGACY),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/bootloader-esp32c3.bin -o $(TOPDIR)/bootloader-esp32c3.bin
$(Q) curl -L $(BOOTLOADER_URL)/partition-table-esp32c3.bin -o $(TOPDIR)/partition-table-esp32c3.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32c3.bin,$(TOPDIR)/mcuboot-esp32c3.bin)
$(call DOWNLOAD,$(BOOTLOADER_URL),partition-table-esp32c3.bin,$(TOPDIR)/partition-table-esp32c3.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/bootloader-esp32c3.bin)

View file

@ -189,8 +189,7 @@ WIRELESS_DRV_ZIP = $(WIRELESS_DRV_ID).zip
WIRELESS_DRV_URL = https://github.com/espressif/esp-wireless-drivers-3rdparty/archive
$(WIRELESS_DRV_ZIP):
$(Q) echo "Downloading: ESP Wireless Drivers"
$(Q) curl -L $(WIRELESS_DRV_URL)/$(WIRELESS_DRV_ZIP) -o chip/$(WIRELESS_DRV_ZIP)
$(call DOWNLOAD,$(WIRELESS_DRV_URL),$(WIRELESS_DRV_ZIP),chip/$(WIRELESS_DRV_ZIP))
chip/$(WIRELESS_DRV_UNPACK): $(WIRELESS_DRV_ZIP)
$(Q) echo "Unpacking: ESP Wireless Drivers"

View file

@ -43,8 +43,7 @@ OPENSBI_TARBALL = opensbi.tar.gz
OPENSBI_DIR = riscv-software-src-opensbi-4998a71
$(OPENSBI_TARBALL):
$(Q) echo "Downloading: OpenSBI"
$(Q) curl -L $(OPENSBI_URL)/$(OPENSBI_COMMIT) -o opensbi/$(OPENSBI_TARBALL)
$(call DOWNLOAD,$(OPENSBI_URL),$(OPENSBI_COMMIT),opensbi/$(OPENSBI_TARBALL))
.opensbi_unpack: $(OPENSBI_TARBALL)
$(Q) echo "Unpacking: OpenSBI"

View file

@ -177,8 +177,7 @@ BOOTLOADER_URL = https://github.com/espressif/esp-nuttx-bootloader/releases/
ifeq ($(CONFIG_ESP32_APP_FORMAT_MCUBOOT),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/mcuboot-esp32.bin -o $(TOPDIR)/mcuboot-esp32.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32.bin,$(TOPDIR)/mcuboot-esp32.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/mcuboot-esp32.bin)
@ -186,9 +185,8 @@ clean_bootloader:
else ifeq ($(CONFIG_ESP32_APP_FORMAT_LEGACY),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/bootloader-esp32.bin -o $(TOPDIR)/bootloader-esp32.bin
$(Q) curl -L $(BOOTLOADER_URL)/partition-table-esp32.bin -o $(TOPDIR)/partition-table-esp32.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32.bin,$(TOPDIR)/mcuboot-esp32.bin)
$(call DOWNLOAD,$(BOOTLOADER_URL),partition-table-esp32.bin,$(TOPDIR)/partition-table-esp32.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/bootloader-esp32.bin)

View file

@ -201,8 +201,7 @@ WIRELESS_DRV_ZIP = $(WIRELESS_DRV_ID).zip
WIRELESS_DRV_URL = https://github.com/espressif/esp-wireless-drivers-3rdparty/archive
$(WIRELESS_DRV_ZIP):
$(Q) echo "Downloading: ESP Wireless Drivers"
$(Q) curl -L $(WIRELESS_DRV_URL)/$(WIRELESS_DRV_ZIP) -o chip/$(WIRELESS_DRV_ZIP)
$(call DOWNLOAD,$(WIRELESS_DRV_URL),$(WIRELESS_DRV_ZIP),chip/$(WIRELESS_DRV_ZIP))
chip/$(WIRELESS_DRV_UNPACK): $(WIRELESS_DRV_ZIP)
$(Q) echo "Unpacking: ESP Wireless Drivers"

View file

@ -166,8 +166,7 @@ BOOTLOADER_URL = https://github.com/espressif/esp-nuttx-bootloader/releases/
ifeq ($(CONFIG_ESP32S2_APP_FORMAT_MCUBOOT),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/mcuboot-esp32s2.bin -o $(TOPDIR)/mcuboot-esp32s2.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32s2.bin,$(TOPDIR)/mcuboot-esp32s2.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/mcuboot-esp32s2.bin)
@ -175,9 +174,8 @@ clean_bootloader:
else ifeq ($(CONFIG_ESP32S2_APP_FORMAT_LEGACY),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/bootloader-esp32s2.bin -o $(TOPDIR)/bootloader-esp32s2.bin
$(Q) curl -L $(BOOTLOADER_URL)/partition-table-esp32s2.bin -o $(TOPDIR)/partition-table-esp32s2.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32s2.bin,$(TOPDIR)/mcuboot-esp32s2.bin)
$(call DOWNLOAD,$(BOOTLOADER_URL),partition-table-esp32s2.bin,$(TOPDIR)/partition-table-esp32s2.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/bootloader-esp32s2.bin)

View file

@ -110,8 +110,7 @@ BOOTLOADER_URL = https://github.com/espressif/esp-nuttx-bootloader/releases/
ifeq ($(CONFIG_ESP32S3_APP_FORMAT_MCUBOOT),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/mcuboot-esp32s3.bin -o $(TOPDIR)/mcuboot-esp32s3.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32s3.bin,$(TOPDIR)/mcuboot-esp32s3.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/mcuboot-esp32s3.bin)
@ -119,9 +118,8 @@ clean_bootloader:
else ifeq ($(CONFIG_ESP32S3_APP_FORMAT_LEGACY),y)
bootloader:
$(Q) echo "Downloading Bootloader binaries"
$(Q) curl -L $(BOOTLOADER_URL)/bootloader-esp32s3.bin -o $(TOPDIR)/bootloader-esp32s3.bin
$(Q) curl -L $(BOOTLOADER_URL)/partition-table-esp32s3.bin -o $(TOPDIR)/partition-table-esp32s3.bin
$(call DOWNLOAD,$(BOOTLOADER_URL),mcuboot-esp32s3.bin,$(TOPDIR)/mcuboot-esp32s3.bin)
$(call DOWNLOAD,$(BOOTLOADER_URL),partition-table-esp32s3.bin,$(TOPDIR)/partition-table-esp32s3.bin)
clean_bootloader:
$(call DELFILE,$(TOPDIR)/bootloader-esp32s3.bin)

View file

@ -47,7 +47,7 @@ ifeq ($(CONFIG_SEGGER_RTT),y)
# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(SGDIR)/RTT/.git),)
$(SGDIR)/RTT.zip:
$(Q) curl -L https://github.com/SEGGERMicro/RTT/archive/refs/tags/V$(RTT_VERSION).zip -o $(SGDIR)/RTT.zip
$(call DOWNLOAD,https://github.com/SEGGERMicro/RTT/archive/refs/tags,V$(RTT_VERSION).zip,$(SGDIR)/RTT.zip)
$(Q) unzip -o $(SGDIR)/RTT.zip -d $(SGDIR)
$(Q) mv $(SGDIR)/RTT-$(RTT_VERSION) $(SGDIR)/RTT
$(Q) patch -p0 < segger/0001-segger-RTT-include-the-SEGGER_RTT_Conf.h-from-custom.patch
@ -78,7 +78,7 @@ ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(SGDIR)/SystemView/.git),)
$(SGDIR)/SystemView.zip:
$(Q) curl -L https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V$(SYSVIEW_VERSION).zip -o $(SGDIR)/SystemView.zip
$(call DOWNLOAD,https://github.com/SEGGERMicro/SystemView/archive/refs/tags,V$(SYSVIEW_VERSION).zip,$(SGDIR)/SystemView.zip)
$(Q) unzip -o $(SGDIR)/SystemView.zip -d $(SGDIR)
$(Q) mv $(SGDIR)/SystemView-$(SYSVIEW_VERSION) $(SGDIR)/SystemView

View file

@ -45,7 +45,7 @@ LITTLEFS_VERSION ?= 2.4.0
LITTLEFS_TARBALL = v$(LITTLEFS_VERSION).tar.gz
$(LITTLEFS_TARBALL):
$(Q) curl -L -o littlefs/$(LITTLEFS_TARBALL) https://github.com/ARMmbed/littlefs/archive/$(LITTLEFS_TARBALL)
$(call DOWNLOAD,https://github.com/ARMmbed/littlefs/archive,$(LITTLEFS_TARBALL),littlefs/$(LITTLEFS_TARBALL))
.littlefsunpack: $(LITTLEFS_TARBALL)
$(Q) tar zxf littlefs/$(LITTLEFS_TARBALL) -C littlefs

View file

@ -26,7 +26,7 @@ VERSION=0.1.9
# Download and unpack tarball if no git repo found
ifeq ($(wildcard libsamplerate/.git),)
libsamplerate:
$(Q) curl -L https://codeload.github.com/libsndfile/libsamplerate/zip/master -o libsamplerate.zip
$(call DOWNLOAD,https://codeload.github.com/libsndfile/libsamplerate/zip,master,libsamplerate.zip)
$(Q) unzip -o libsamplerate.zip
$(Q) mv libsamplerate-master libsamplerate
endif

View file

@ -83,10 +83,10 @@ tzbin:
mkdir tzbin
tzcode-latest.tar.gz:
$(Q) curl -L -O ftp://ftp.iana.org/tz/tzcode-latest.tar.gz
$(call DOWNLOAD,ftp://ftp.iana.org/tz,tzcode-latest.tar.gz)
tzdata-latest.tar.gz:
$(Q) curl -L -O ftp://ftp.iana.org/tz/tzdata-latest.tar.gz
$(call DOWNLOAD,ftp://ftp.iana.org/tz,tzdata-latest.tar.gz)
.tzunpack: tzcode tzcode-latest.tar.gz tzdata-latest.tar.gz
$(Q) tar zx -C tzcode -f tzcode-latest.tar.gz

View file

@ -23,7 +23,7 @@ ETL_VERSION=20.32.1
# Download and unpack tarball if no git repo found
ifeq ($(wildcard etl/.git),)
$(ETL_VERSION).tar.gz:
$(Q) curl -O -L https://github.com/ETLCPP/etl/archive/refs/tags/$(ETL_VERSION).tar.gz
$(call DOWNLOAD,https://github.com/ETLCPP/etl/archive/refs/tags,$(ETL_VERSION).tar.gz)
etl: $(ETL_VERSION).tar.gz
$(Q) tar -xf $(ETL_VERSION).tar.gz

View file

@ -23,7 +23,7 @@ LIBCXX_VERSION=12.0.0
# Download and unpack tarball if no git repo found
ifeq ($(wildcard libcxx/.git),)
libcxx-$(LIBCXX_VERSION).src.tar.xz:
$(Q) curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXX_VERSION)/libcxx-$(LIBCXX_VERSION).src.tar.xz
$(call DOWNLOAD,https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXX_VERSION),libcxx-$(LIBCXX_VERSION).src.tar.xz)
libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz
$(Q) tar -xf libcxx-$(LIBCXX_VERSION).src.tar.xz \

View file

@ -21,7 +21,7 @@
LIBCXXABI_VERSION=12.0.0
libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz:
$(Q) curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXXABI_VERSION)/libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
$(call DOWNLOAD,https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXXABI_VERSION),libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz)
libcxxabi: libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
$(Q) tar -xf libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz

View file

@ -70,7 +70,7 @@ LIBMETAL_HDRS_SEDEXP := \
ifeq ($(wildcard libmetal/.git),)
libmetal.zip:
# Download and unpack tarball if no git repo found
$(Q) curl -L https://github.com/OpenAMP/libmetal/archive/v$(VERSION).zip -o libmetal.zip
$(call DOWNLOAD,https://github.com/OpenAMP/libmetal/archive,v$(VERSION).zip,libmetal.zip)
$(Q) unzip -o libmetal.zip
$(Q) mv libmetal-$(VERSION) libmetal

View file

@ -32,7 +32,7 @@ CSRCS += open-amp/lib/virtio/virtqueue.c
# Download and unpack tarball if no git repo found
ifeq ($(wildcard open-amp/.git),)
open-amp.zip:
$(Q) curl -L https://github.com/OpenAMP/open-amp/archive/v$(VERSION).zip -o open-amp.zip
$(call DOWNLOAD,https://github.com/OpenAMP/open-amp/archive,v$(VERSION).zip,open-amp.zip)
$(Q) unzip -o open-amp.zip
$(Q) mv open-amp-$(VERSION) open-amp
$(Q) patch -p0 < 0001-ns-acknowledge-the-received-creation-message.patch

View file

@ -555,6 +555,18 @@ define FINDSCRIPT
$(if $(wildcard $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(1)),$(BOARD_DIR)$(DELIM)scripts$(DELIM)$(1),$(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)$(1))
endef
# DOWNLOAD - 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 DOWNLOAD,$(FOO_URL_BASE),$(FOO_TARBALL),foo.out,foo-)
define DOWNLOAD
$(ECHO_BEGIN)"Downloading: $(if $3,$3,$2) "
$(Q) curl -L $(if $(V),,-Ss) $(1)/$(2) -o $(if $(3),$(3),$(2))
$(ECHO_END)
endef
# CLEAN - Default clean target
ifeq ($(CONFIG_ARCH_COVERAGE),y)