nuttx-apps/interpreters/toywasm/Makefile
YAMAMOTO Takashi 1094573025 toywasm: bump to v67.0.0
see below for the included changes.
the "fix GCC warnings for the target with long uint32_t" change
is for https://github.com/apache/nuttx/pull/16022.

```shell
2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef wapm.toml: bump the version
95fdefcd3ea85ce18d0fd9c41536e609f6b0d7b2 suppress ubsan complaints on function type mismatches
9e131d0b86f29f453b51390e7a57db2f12efa8af fix a type in a comment
6832384862dab5f44b5328dbfe2a09cdba35713b platform.h: add WRONG_FUNC_TYPE macro to suppress -fsanitize=function
50062832c0481f4dcc67458fcfd2e1184e423d8b fix GCC warnings for the target with long uint32_t
04861b1084cd4925d99bfc758d5ae00359360c5d explain a cryptic dyld error
569aaa9b0ab6309311f331cdf3376e8d4445b1c0 libwasi_littlefs: emulate preadv/pwritev
b3f665319efe68215d9c9f51f489ba61b03c27fb ci: bump littlefs version
fe5cd58608c0eab0e3383626988240da1971a6ba fix debug info with IPO on macOS
7ef1b8abc4e4d1558986336732f21cf54f6abc58 libwasi_littlefs: fix crashes with non-debug builds
abb5efe1141721225945087d414d348f4afd4976 libwasi_littlefs: fix a few races
125d8973b485583d3ac4a8c4a60f97334135ee53 lfs_error_to_errno: translate unknown values to EIO
f1eda35d45229d02c7e23c872d2e0faeb9b2c731 Fix compilation errors with the latest macOS 15.2 SDK
3a01d8c5a063c18c8ebc58c45a61c7dd12cd4b75 libwasi_littlefs/README.md: remove a stale section
b7f015fd933fd330ed6e4e6f9af0dfc7b280e70d CI: update actions/upload-artifact download-artifact to v4
3a90622e105a2064878d4d63fc5e4566c6d1906b comment
6cdb84116abb930e903221231dd657ec08fec9e2 cmake: add custom-page-sizes tests
a2958960f59b6b0ccf7733fc3db301236991ff0b add run-wasm3-spec-test-custom-page-sizes.sh
f1029a818e638e0a5995a7fef43988592e709740 fetch-spec-test.sh: bump wasm-spec-test
7aa3d9050abcac11f7f8abef12ced6334acf0670 prepare-spec-test.sh: use my fork of custom-page-sizes for now
c987677a10557a0f938e3c10cfd05e5d741cf51e fetch-spec-test.sh: bump wasm-spec-test
c9372193a766c145a76a7ceaf79c820ce4576ce8 test/prepare-spec-test.sh: add custom-pages-sizes tests
9a74326a8d9503151ca3868ea6ed855293cb77b1 doc
cc700465b4275cc27007950f00ecf5079f68a778 comment
1700c523acf9fa3ba20772731eb04096852902a2 add a comment
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-13 11:31:36 +08:00

181 lines
5.1 KiB
Makefile

############################################################################
# apps/interpreters/toywasm/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
PROGNAME = toywasm
PRIORITY = $(CONFIG_INTERPRETERS_TOYWASM_PRIORITY)
STACKSIZE = $(CONFIG_INTERPRETERS_TOYWASM_STACKSIZE)
MODULE = $(CONFIG_INTERPRETERS_TOYWASM)
# cli
MAINSRC = main.c
CSRCS += str_to_uint.c
CSRCS += repl.c
# lib
CSRCS += bitmap.c
CSRCS += cconv.c
CSRCS += cell.c
CSRCS += context.c
CSRCS += decode.c
CSRCS += dummy_host_func.c
CSRCS += endian.c
CSRCS += escape.c
CSRCS += exec.c
CSRCS += exec_debug.c
CSRCS += exec_insn_subr.c
CSRCS += expr.c
CSRCS += expr_parser.c
CSRCS += fileio.c
CSRCS += host_instance.c
CSRCS += idalloc.c
CSRCS += import_object.c
CSRCS += insn.c
CSRCS += instance.c
CSRCS += leb128.c
CSRCS += list.c
CSRCS += load_context.c
CSRCS += mem.c
CSRCS += module.c
CSRCS += module_writer.c
CSRCS += name.c
CSRCS += nbio.c
CSRCS += options.c
CSRCS += report.c
CSRCS += restart.c
CSRCS += shared_memory.c
CSRCS += slist.c
CSRCS += timeutil.c
CSRCS += toywasm_config.c
CSRCS += type.c
CSRCS += util.c
CSRCS += validation.c
CSRCS += vec.c
CSRCS += xlog.c
# TOYWASM_ENABLE_WASM_THREADS
CSRCS += cluster.c
CSRCS += lock.c
CSRCS += suspend.c
CSRCS += waitlist.c
#CSRCS += usched.c
# libwasi
CSRCS += wasi.c
CSRCS += wasi_abi_clock.c
CSRCS += wasi_abi_environ.c
CSRCS += wasi_abi_fd.c
CSRCS += wasi_abi_path.c
CSRCS += wasi_abi_poll.c
CSRCS += wasi_abi_prestat.c
CSRCS += wasi_abi_proc.c
CSRCS += wasi_abi_random.c
CSRCS += wasi_abi_sched.c
CSRCS += wasi_abi_sock.c
CSRCS += wasi_fdinfo.c
CSRCS += wasi_fdtable.c
CSRCS += wasi_host_dirent.c
CSRCS += wasi_host_fdop.c
CSRCS += wasi_host_pathop.c
CSRCS += wasi_host_subr.c
CSRCS += wasi_path_subr.c
CSRCS += wasi_poll_subr.c
CSRCS += wasi_subr.c
CSRCS += wasi_table.c
CSRCS += wasi_uio.c
CSRCS += wasi_vfs.c
CSRCS += wasi_vfs_impl_host.c
# TOYWASM_ENABLE_WASI_THREADS
CSRCS += wasi_threads.c
# libwasi_littlefs TOYWASM_ENABLE_WASI_LITTLEFS
#CSRCS += wasi_littlefs.c
#CSRCS += wasi_littlefs_impl.c
#CSRCS += wasi_littlefs_mount.c
#CSRCS += wasi_littlefs_ops.c
#CSRCS += wasi_vfs_impl_littlefs.c
#CSRCS += lfs.c
#CSRCS += lfs_util.c
#toywasm/libwasi_littlefs/littlefs/lfs.c_CFLAGS += -Wno-shadow
#CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libwasi_littlefs
#CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libwasi_littlefs/littlefs
#CFLAGS += -DLFS_THREADSAFE
#VPATH += $(TOYWASM_UNPACK)/libwasi_littlefs
#VPATH += $(TOYWASM_UNPACK)/libwasi_littlefs/littlefs
# TOYWASM_ENABLE_DYLD
CSRCS += dyld.c
CSRCS += dyld_plt.c
CSRCS += dyld_stats.c
# TOYWASM_ENABLE_DYLD_DLFCN
CSRCS += dyld_dlfcn.c
ifeq ($(shell $(CC) --version | grep -i clang),)
CFLAGS += -Wno-maybe-uninitialized
endif
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/include
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/lib
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libwasi
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libwasi_threads
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libdyld
# Keep the compilation parameters consistent with toywasm mainline
# https://github.com/yamt/toywasm/blob/master/cmake/ToywasmConfig.cmake#L298-L302
CFLAGS += -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-variable -Wno-return-type
TOYWASM_VERSION = 2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef
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 += $(TOYWASM_UNPACK)/libwasi
VPATH += $(TOYWASM_UNPACK)/libwasi_threads
VPATH += $(TOYWASM_UNPACK)/libdyld
VPATH += src
$(TOYWASM_TARBALL):
$(Q) echo "Downloading $(TOYWASM_TARBALL)"
$(Q) curl -O -L $(TOYWASM_URL)
$(TOYWASM_UNPACK): $(TOYWASM_TARBALL)
$(Q) echo "Unpacking $(TOYWASM_TARBALL) to $(TOYWASM_UNPACK)"
$(Q) unzip $(TOYWASM_TARBALL)
$(Q) mv toywasm-$(TOYWASM_VERSION) $(TOYWASM_UNPACK)
$(Q) touch $(TOYWASM_UNPACK)
# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(TOYWASM_UNPACK)/.git),)
context:: $(TOYWASM_UNPACK)
distclean::
$(call DELDIR, $(TOYWASM_UNPACK))
$(call DELFILE, $(TOYWASM_TARBALL))
endif
include $(APPDIR)/Application.mk