Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: silent download, unpack and others #1630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,21 @@ HEAD_OBJ += $(wildcard $(APPDIR)$(DELIM)import$(DELIM)startup$(DELIM)*$(OBJEXT))
HEAD_OBJ += $(wildcard $(APPDIR)$(DELIM)builtin$(DELIM)*$(OBJEXT))

.import: $(BIN) install
$(Q) echo "LD: nuttx"
$(ECHO_BEGIN)"LD: nuttx "
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LDLIBPATH) $(EXTRA_LIBPATHS) \
-L$(APPDIR)$(DELIM)import$(DELIM)scripts -T$(LDNAME) \
-o nuttx$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) $(LDSTARTGROUP) \
$(BIN) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
$(ECHO_END)
ifeq ($(CONFIG_INTELHEX_BINARY),y)
$(Q) echo "CP: nuttx.hex"
$(ECHO_BEGIN)"CP: nuttx.hex "
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex nuttx$(EXEEXT) nuttx.hex
$(ECHO_END)
endif
ifeq ($(CONFIG_RAW_BINARY),y)
$(Q) echo "CP: nuttx.bin"
$(ECHO_BEGIN)"CP: nuttx.bin "
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary nuttx$(EXEEXT) nuttx.bin
$(ECHO_END)
endif
$(call POSTBUILD, $(APPDIR))

Expand Down
7 changes: 4 additions & 3 deletions boot/mcuboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
include $(APPDIR)/Make.defs

MCUBOOT_VERSION := $(patsubst "%",%,$(CONFIG_MCUBOOT_VERSION))
MCUBOOT_URL_BASE = https://github.com/mcu-tools/mcuboot/archive
MCUBOOT_TARBALL = $(MCUBOOT_VERSION).tar.gz
MCUBOOT_UNPACK = mcuboot
MCUBOOT_SRCDIR = $(MCUBOOT_UNPACK)$(DELIM)boot$(DELIM)bootutil$(DELIM)src
Expand Down Expand Up @@ -77,14 +78,14 @@ CXXFLAGS += ${INCDIR_PREFIX}mcuboot/ext/tinycrypt/lib/include
endif

$(MCUBOOT_TARBALL):
$(Q) echo "Downloading MCUboot-$(MCUBOOT_VERSION)"
$(Q) curl -O -L https://github.com/mcu-tools/mcuboot/archive/$(MCUBOOT_TARBALL)
$(call DOWNLOAD,$(MCUBOOT_URL_BASE),$(MCUBOOT_TARBALL))

$(MCUBOOT_UNPACK): $(MCUBOOT_TARBALL)
$(Q) echo "Unpacking: $(MCUBOOT_TARBALL) -> $(MCUBOOT_UNPACK)"
$(ECHO_BEGIN)"Unpacking: $(MCUBOOT_TARBALL) -> $(MCUBOOT_UNPACK) "
$(Q) tar zxf $(MCUBOOT_TARBALL)
$(Q) mv mcuboot-$(MCUBOOT_VERSION) $(MCUBOOT_UNPACK)
$(Q) touch $(MCUBOOT_UNPACK)
$(ECHO_END)

# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(MCUBOOT_UNPACK)/.git),)
Expand Down
11 changes: 6 additions & 5 deletions canutils/lely-canopen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,16 @@ endif
# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(LELYCANOPEN_SRCNAME)/.git),)
$(LELYCANOPEN_TARBALL):
@echo "Downloading: $(LELYCANOPEN_TARBALL)"
$(Q) curl -L -O $(CONFIG_CANUTILS_LELYCANOPEN_URL)/$(LELYCANOPEN_TARBALL)
$(call DOWNLOAD,$(CONFIG_CANUTILS_LELYCANOPEN_URL),$(LELYCANOPEN_TARBALL))

$(LELYCANOPEN_SRCNAME): $(LELYCANOPEN_TARBALL)
@echo "Unpacking: $(LELYCANOPEN_TARBALL) -> $(LELYCANOPEN_UNPACKNAME)"
$(ECHO_BEGIN)"Unpacking: $(LELYCANOPEN_TARBALL) -> $(LELYCANOPEN_UNPACKNAME) "
$(Q) $(UNPACK) $(LELYCANOPEN_TARBALL)
$(Q) mv $(LELYCANOPEN_UNPACKNAME) $(LELYCANOPEN_SRCNAME)
$(Q) cat 0001-NuttX-port.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1
$(Q) echo "Patching $(LELYCANOPEN_SRCNAME)"
$(ECHO_END)
$(ECHO_BEGIN)"Patching $(LELYCANOPEN_SRCNAME) "
$(Q) patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1 < 0001-NuttX-port.patch
$(ECHO_END)
endif

context:: $(LELYCANOPEN_SRCNAME)
Expand Down
9 changes: 5 additions & 4 deletions crypto/libtomcrypt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -464,17 +464,18 @@ endif
endif

$(LIBTOMCRYPT_ZIP):
@echo "Downloading: $(LIBTOMCRYPT_ZIP)"
$(Q) curl -O -L $(CONFIG_LIBTOMCRYPT_URL)/$(LIBTOMCRYPT_ZIP)
$(call DOWNLOAD,$(CONFIG_LIBTOMCRYPT_URL),$(LIBTOMCRYPT_ZIP))

$(LIBTOMCRYPT_UNPACKNAME): $(LIBTOMCRYPT_ZIP)
@echo "Unpacking: $(LIBTOMCRYPT_ZIP) -> $(LIBTOMCRYPT_UNPACKNAME)"
$(ECHO_BEGIN)"Unpacking: $(LIBTOMCRYPT_ZIP) -> $(LIBTOMCRYPT_UNPACKNAME) "
$(Q) $(UNPACK) $(LIBTOMCRYPT_ZIP)
$(Q) mv libtomcrypt-$(LIBTOMCRYPT_VERSION) $(LIBTOMCRYPT_UNPACKNAME)
$(Q) echo "Patching $(LIBTOMCRYPT_UNPACKNAME)"
$(ECHO_END)
$(ECHO_BEGIN)"Patching $(LIBTOMCRYPT_UNPACKNAME) "
$(Q) patch -p0 < digit-bit.patch # Update deprecated macro from ltm
$(Q) patch -p0 < ltcrypt-flush.patch # Missing stdout flush in demo app
$(Q) touch $(LIBTOMCRYPT_UNPACKNAME)
$(ECHO_END)

# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(LIBTOMCRYPT_UNPACKNAME)/.git),)
Expand Down
7 changes: 2 additions & 5 deletions graphics/lvgl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,14 @@ LVGL_TARBALL = v$(LVGL_VERSION).zip

LVGL_UNPACKNAME = lvgl
UNPACK ?= unzip -o $(if $(V),,-q)
CURL ?= curl -L -O $(if $(V),,-Ss)

LVGL_UNPACKDIR = $(WD)/$(LVGL_UNPACKNAME)

$(LVGL_TARBALL):
$(ECHO_BEGIN)"Downloading: $(LVGL_TARBALL)"
$(Q) $(CURL) $(CONFIG_GRAPH_LVGL_URL)/$(LVGL_TARBALL)
$(ECHO_END)
$(call DOWNLOAD,$(CONFIG_GRAPH_LVGL_URL),$(LVGL_TARBALL))

$(LVGL_UNPACKNAME): $(LVGL_TARBALL)
$(ECHO_BEGIN)"Unpacking: $(LVGL_TARBALL) -> $(LVGL_UNPACKNAME)"
$(ECHO_BEGIN)"Unpacking: $(LVGL_TARBALL) -> $(LVGL_UNPACKNAME) "
$(Q) $(UNPACK) $(LVGL_TARBALL)
$(Q) mv lvgl-$(LVGL_VERSION) $(LVGL_UNPACKNAME)
$(Q) touch $(LVGL_UNPACKNAME)
Expand Down
7 changes: 3 additions & 4 deletions industry/scpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ SCPI_VERSION = 2.2
SCPI_UNPACK = scpi-parser
SCPI_TARBALL = v$(SCPI_VERSION).tar.gz
SCPI_URL_BASE = https://github.com/j123b567/scpi-parser/archive/refs/tags
SCPI_URL = $(SCPI_URL_BASE)/$(SCPI_TARBALL)

CSRCS += error.c fifo.c ieee488.c
CSRCS += minimal.c parser.c units.c utils.c
Expand All @@ -51,11 +50,11 @@ VPATH += $(SCPI_UNPACK)/examples/common
endif # CONFIG_SCPI_PARSER_DEMO

$(SCPI_TARBALL):
$(Q) echo "Downloading $(SCPI_TARBALL)"
$(Q) curl -O -L $(SCPI_URL)
$(Q) echo "Unpacking $(SCPI_TARBALL) to $(SCPI_UNPACK)"
$(call DOWNLOAD,$(SCPI_URL_BASE),$(SCPI_TARBALL))
$(ECHO_BEGIN)"Unpacking $(SCPI_TARBALL) to $(SCPI_UNPACK) "
$(Q) tar xzvf $(SCPI_TARBALL)
$(Q) mv scpi-parser-$(SCPI_VERSION) $(SCPI_UNPACK)
$(ECHO_END)

# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(SCPI_UNPACK)/.git),)
Expand Down
10 changes: 5 additions & 5 deletions interpreters/duktape/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ DUKTAPE_VERSION = 2.5.0
DUKTAPE_UNPACK = duktape
DUKTAPE_TARBALL = duktape-$(DUKTAPE_VERSION).tar.xz
DUKTAPE_URL_BASE = https://github.com/svaarala/duktape/releases/download/
DUKTAPE_URL = $(DUKTAPE_URL_BASE)v$(DUKTAPE_VERSION)/$(DUKTAPE_TARBALL)

CSRCS = duktape.c
CSRCS += duk_console.c
Expand All @@ -49,15 +48,16 @@ CFLAGS += -DDUK_CMDLINE_CONSOLE_SUPPORT
CFLAGS += -DDUK_CMDLINE_PRINTALERT_SUPPORT

$(DUKTAPE_TARBALL):
$(Q) echo "Downloading $(DUKTAPE_TARBALL)"
$(Q) curl -O -L $(DUKTAPE_URL)
$(call DOWNLOAD,$(DUKTAPE_URL_BASE),$(DUKTAPE_TARBALL))

$(DUKTAPE_UNPACK): $(DUKTAPE_TARBALL)
$(Q) echo "Unpacking $(DUKTAPE_TARBALL) to $(DUKTAPE_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(DUKTAPE_TARBALL) to $(DUKTAPE_UNPACK) "
$(Q) tar xfJ $(DUKTAPE_TARBALL)
$(Q) mv duktape-$(DUKTAPE_VERSION) $(DUKTAPE_UNPACK)
$(Q) echo "Patching $(DUKTAPE_UNPACK)"
$(ECHO_END)
$(ECHO_BEGIN)"Patching $(DUKTAPE_UNPACK) "
$(Q) patch -p0 < duk_cmdline.patch
$(ECHO_END)

$(DUKTAPE_UNPACK)/.patch: $(DUKTAPE_UNPACK)
$(Q) touch $(DUKTAPE_UNPACK)/.patch
Expand Down
7 changes: 3 additions & 4 deletions interpreters/lua/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ LUA_VERSION = $(patsubst "%",%,$(strip $(CONFIG_INTERPRETER_LUA_VERSION)))
LUA_TARBALL = lua-$(LUA_VERSION).tar.gz
LUA_UNPACK = lua-$(LUA_VERSION)
LUA_URL_BASE = http://www.lua.org/ftp
LUA_URL = $(LUA_URL_BASE)/$(LUA_TARBALL)
LUA_SRC = $(LUA_UNPACK)$(DELIM)src

MAINSRC = $(LUA_SRC)$(DELIM)lua.c
Expand Down Expand Up @@ -68,10 +67,10 @@ endif
# Lua download and unpack

$(LUA_TARBALL):
$(Q) echo "Downloading $(LUA_TARBALL)"
$(Q) curl -O -L $(LUA_URL)
$(Q) echo "Unpacking $(LUA_TARBALL) to $(LUA_UNPACK)"
$(call DOWNLOAD,$(LUA_URL_BASE),$(LUA_TARBALL))
$(ECHO_BEGIN)"Unpacking $(LUA_TARBALL) to $(LUA_UNPACK) "
$(Q) tar -xvzf $(LUA_TARBALL)
$(ECHO_END)

# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(LUA_UNPACK)/.git),)
Expand Down
6 changes: 4 additions & 2 deletions interpreters/lua/Module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
LUAMOD_REGISTRY = $(APPDIR)$(DELIM)interpreters$(DELIM)lua$(DELIM)registry

define LUAMOD_REGISTER
$(Q) echo Register Lua Module: $1
$(ECHO_BEGIN)"Register Lua Module: $1 "
$(Q) echo { \"$1\", $2 }, > "$(LUAMOD_REGISTRY)$(DELIM)$1.bdat"
$(Q) echo "int $2(lua_State *L);" > "$(LUAMOD_REGISTRY)$(DELIM)$1.pdat"
$(ECHO_END)
$(ECHO_BEGIN)"int $2(lua_State *L);" > "$(LUAMOD_REGISTRY)$(DELIM)$1.pdat "
$(Q) touch "$(LUAMOD_REGISTRY)$(DELIM).updated"
$(ECHO_END)
endef

ifneq ($(LUAMODNAME),)
Expand Down
7 changes: 3 additions & 4 deletions interpreters/luamodules/cjson/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ LUACJSON_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LUA_CJSON_VERSION)))
LUACJSON_TARBALL = $(LUACJSON_VERSION).tar.gz
LUACJSON_UNPACK = lua-cjson
LUACJSON_URL_BASE = https://github.com/openresty/lua-cjson/archive/refs/tags
LUACJSON_URL = $(LUACJSON_URL_BASE)/$(LUACJSON_TARBALL)
LUACJSON_SRC = $(LUACJSON_UNPACK)

VPATH += lua-cjson
CSRCS = lua_cjson.c strbuf.c fpconv.c

$(LUACJSON_TARBALL):
$(Q) echo "Downloading $(LUACJSON_TARBALL) from $(LUACJSON_URL)"
$(Q) curl -O -L $(LUACJSON_URL)
$(call DOWNLOAD,$(LUACJSON_URL_BASE),$(LUACJSON_TARBALL))

$(LUACJSON_UNPACK): $(LUACJSON_TARBALL)
$(Q) echo "Unpacking $(LUACJSON_TARBALL) to $(LUACJSON_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(LUACJSON_TARBALL) to $(LUACJSON_UNPACK) "
$(Q) tar -xvzf $(LUACJSON_TARBALL)
$(Q) mv lua-cjson-$(LUACJSON_VERSION) $(LUACJSON_UNPACK)
$(Q) patch -d $(LUACJSON_UNPACK) -p1 < 0001-fix-compile-warnings.patch
$(ECHO_END)

$(LUACJSON_UNPACK)/.patch: $(LUACJSON_UNPACK)
touch $(LUACJSON_UNPACK)/.patch
Expand Down
7 changes: 3 additions & 4 deletions interpreters/luamodules/lfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ LFS_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LUA_LFS_VERSION)))
LFS_TARBALL = v$(LFS_VERSION).tar.gz
LFS_UNPACK = lfs
LFS_URL_BASE = https://github.com/lunarmodules/luafilesystem/archive/refs/tags
LFS_URL = $(LFS_URL_BASE)/$(LFS_TARBALL)
LFS_SRC = $(LFS_UNPACK)$(DELIM)src

VPATH += $(LFS_SRC)
CSRCS = lfs.c

$(LFS_TARBALL):
$(Q) echo "Downloading $(LFS_TARBALL) from $(LFS_URL)"
$(Q) curl -O -L $(LFS_URL)
$(call DOWNLOAD,$(LFS_URL_BASE),$(LFS_TARBALL))

$(LFS_UNPACK): $(LFS_TARBALL)
$(Q) echo "Unpacking $(LFS_TARBALL) to $(LFS_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(LFS_TARBALL) to $(LFS_UNPACK) "
$(Q) tar -xvzf $(LFS_TARBALL)
$(Q) mv luafilesystem-$(LFS_VERSION) $(LFS_UNPACK)
$(Q) patch -d $(LFS_UNPACK) -p1 < 0001-call-symlink-or-link-directly.patch
$(ECHO_END)

$(LFS_UNPACK)/.patch: $(LFS_UNPACK)
touch $(LFS_UNPACK)/.patch
Expand Down
7 changes: 3 additions & 4 deletions interpreters/luamodules/luasyslog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ LSYSLOG_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LUA_LSYSLOG_VERSION)))
LSYSLOG_TARBALL = $(LSYSLOG_VERSION).tar.gz
LSYSLOG_UNPACK = lsyslog
LSYSLOG_URL_BASE = https://github.com/lunarmodules/luasyslog/archive/refs/tags
LSYSLOG_URL = $(LSYSLOG_URL_BASE)/$(LSYSLOG_TARBALL)
LSYSLOG_SRC = $(LSYSLOG_UNPACK)

VPATH += $(LSYSLOG_SRC)
Expand All @@ -34,13 +33,13 @@ CFLAGS += -D'openlog(a,b,c)={(void)a; (void)c;}'
CFLAGS += -D'closelog()={}'

$(LSYSLOG_TARBALL):
$(Q) echo "Downloading $(LSYSLOG_TARBALL) from $(LSYSLOG_URL)"
$(Q) curl -O -L $(LSYSLOG_URL)
$(call DOWNLOAD,$(LSYSLOG_URL_BASE),$(LSYSLOG_TARBALL))

$(LSYSLOG_UNPACK): $(LSYSLOG_TARBALL)
$(Q) echo "Unpacking $(LSYSLOG_TARBALL) to $(LSYSLOG_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(LSYSLOG_TARBALL) to $(LSYSLOG_UNPACK) "
$(Q) tar -xvzf $(LSYSLOG_TARBALL)
$(Q) mv luasyslog-$(LSYSLOG_VERSION) $(LSYSLOG_UNPACK)
$(ECHO_END)

$(LSYSLOG_UNPACK)/.patch: $(LSYSLOG_UNPACK)
touch $(LSYSLOG_UNPACK)/.patch
Expand Down
7 changes: 3 additions & 4 deletions interpreters/luamodules/luv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ LUV_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LUA_LUV_VERSION)))
LUV_TARBALL = luv-$(LUV_VERSION).tar.gz
LUV_UNPACK = luv
LUV_URL_BASE = https://github.com/luvit/luv/releases/download/
LUV_URL = $(LUV_URL_BASE)/$(LUV_VERSION)/$(LUV_TARBALL)
LUV_SRC = $(LUV_UNPACK)$(DELIM)src

VPATH += $(LUV_SRC)
Expand All @@ -35,14 +34,14 @@ CSRCS = luv.c
# Luv download and unpack

$(LUV_TARBALL):
$(Q) echo "Downloading $(LUV_TARBALL)"
$(Q) curl -O -L $(LUV_URL)
$(call DOWNLOAD,$(LUV_URL_BASE),$(LUV_TARBALL))

$(LUV_UNPACK): $(LUV_TARBALL)
$(Q) echo "Unpacking $(LUV_TARBALL) to $(LUV_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(LUV_TARBALL) to $(LUV_UNPACK) "
$(Q) tar -xvzf $(LUV_TARBALL)
$(Q) mv luv-$(LUV_VERSION) $(LUV_UNPACK)
$(Q) patch -d $(LUV_UNPACK) -p1 < 0001-fix-compile-warnings.patch
$(ECHO_END)

$(LUV_UNPACK)/.patch: $(LUV_UNPACK)
touch $(LUV_UNPACK)/.patch
Expand Down
7 changes: 3 additions & 4 deletions interpreters/quickjs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ QUICKJS_VERSION = 2020-11-08
QUICKJS_UNPACK = quickjs
QUICKJS_TARBALL = quickjs-$(QUICKJS_VERSION).tar.xz
QUICKJS_URL_BASE = https://bellard.org/quickjs/
QUICKJS_URL = $(QUICKJS_URL_BASE)/$(QUICKJS_TARBALL)

CSRCS = quickjs.c libregexp.c libbf.c libunicode.c cutils.c

Expand Down Expand Up @@ -60,14 +59,14 @@ MODULE = $(CONFIG_INTERPRETERS_QUICKJS)
endif

$(QUICKJS_TARBALL):
$(Q) echo "Downloading $(QUICKJS_TARBALL)"
$(Q) curl -O -L $(QUICKJS_URL)
$(call DOWNLOAD,$(QUICKJS_URL_BASE),$(QUICKJS_TARBALL))

$(QUICKJS_UNPACK): $(QUICKJS_TARBALL)
$(Q) echo "Unpacking $(QUICKJS_TARBALL) to $(QUICKJS_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(QUICKJS_TARBALL) to $(QUICKJS_UNPACK) "
$(Q) tar -Jxf $(QUICKJS_TARBALL)
$(Q) mv quickjs-$(QUICKJS_VERSION) $(QUICKJS_UNPACK)
$(Q) patch -d $(QUICKJS_UNPACK) -p1 < 0001-Disabled-unsupported-feature-on-NuttX.patch
$(ECHO_END)

$(QUICKJS_UNPACK)/.patch: $(QUICKJS_UNPACK)
$(Q) touch $(QUICKJS_UNPACK)/.patch
Expand Down
7 changes: 3 additions & 4 deletions interpreters/toywasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,20 @@ TOYWASM_VERSION = 5a1d6bf349571e0b63a9d02d73e01b8e212fb8c0
TOYWASM_UNPACK = toywasm
TOYWASM_TARBALL = $(TOYWASM_VERSION).zip
TOYWASM_URL_BASE = https://github.com/yamt/toywasm/archive/
TOYWASM_URL = $(TOYWASM_URL_BASE)/$(TOYWASM_TARBALL)

VPATH += $(TOYWASM_UNPACK)/cli
VPATH += $(TOYWASM_UNPACK)/lib
VPATH += src

$(TOYWASM_TARBALL):
$(Q) echo "Downloading $(TOYWASM_TARBALL)"
$(Q) curl -O -L $(TOYWASM_URL)
$(call DOWNLOAD,$(TOYWASM_URL_BASE),$(TOYWASM_TARBALL))

$(TOYWASM_UNPACK): $(TOYWASM_TARBALL)
$(Q) echo "Unpacking $(TOYWASM_TARBALL) to $(TOYWASM_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(TOYWASM_TARBALL) to $(TOYWASM_UNPACK) "
$(Q) unzip $(TOYWASM_TARBALL)
$(Q) mv toywasm-$(TOYWASM_VERSION) $(TOYWASM_UNPACK)
$(Q) touch $(TOYWASM_UNPACK)
$(ECHO_END)

# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(TOYWASM_UNPACK)/.git),)
Expand Down
7 changes: 3 additions & 4 deletions interpreters/wamr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ WAMR_UNPACK = wamr

WAMR_TARBALL = $(WAMR_VERSION).zip
WAMR_URL_BASE = https://github.com/bytecodealliance/wasm-micro-runtime/archive/
WAMR_URL = $(WAMR_URL_BASE)/$(WAMR_TARBALL)

-include $(WAMR_UNPACK)/product-mini/platforms/nuttx/wamr.mk

Expand All @@ -41,14 +40,14 @@ MODULE = $(CONFIG_INTERPRETERS_WAMR)
endif

$(WAMR_TARBALL):
$(Q) echo "Downloading $(WAMR_TARBALL)"
$(Q) curl -O -L $(WAMR_URL)
$(call DOWNLOAD,$(WAMR_URL_BASE),$(WAMR_TARBALL))

$(WAMR_UNPACK): $(WAMR_TARBALL)
$(Q) echo "Unpacking $(WAMR_TARBALL) to $(WAMR_UNPACK)"
$(ECHO_BEGIN)"Unpacking $(WAMR_TARBALL) to $(WAMR_UNPACK) "
$(Q) unzip $(WAMR_TARBALL)
$(Q) mv wasm-micro-runtime-$(WAMR_VERSION) $(WAMR_UNPACK)
$(Q) touch $(WAMR_UNPACK)
$(ECHO_END)

# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(WAMR_UNPACK)/.git),)
Expand Down
Loading