mirror of
https://github.com/extism/extism.git
synced 2026-01-09 13:57:55 -05:00
This PR adds the `kernel` directory which contains a port of the Extism memory allocator compiled to WebAssembly and removes `runtime/src/memory.rs` completely. Being able to re-use memory functions as a WASM module allows us to begin to experiment with porting Extism to new runtimes! This is in a draft state while I'm verifying some of these changes.
43 lines
850 B
Makefile
43 lines
850 B
Makefile
DEST?=/usr/local
|
|
SOEXT=so
|
|
FEATURES?=default
|
|
DEFAULT_FEATURES?=yes
|
|
|
|
UNAME := $(shell uname -s)
|
|
ifeq ($(UNAME),Darwin)
|
|
SOEXT=dylib
|
|
endif
|
|
|
|
ifeq ($(DEFAULT_FEATURES),no)
|
|
ifeq ($(FEATURES),default)
|
|
FEATURE_FLAGS=--no-default-features
|
|
else
|
|
FEATURE_FLAGS=--features $(FEATURES) --no-default-features
|
|
endif
|
|
else
|
|
FEATURE_FLAGS=--features $(FEATURES)
|
|
endif
|
|
|
|
build:
|
|
cargo build --release $(FEATURE_FLAGS) --manifest-path libextism/Cargo.toml
|
|
|
|
.PHONY: kernel
|
|
kernel:
|
|
cd kernel && bash build.sh
|
|
|
|
lint:
|
|
cargo clippy --release --no-deps --manifest-path runtime/Cargo.toml
|
|
|
|
debug:
|
|
RUSTFLAGS=-g $(MAKE) build
|
|
|
|
install:
|
|
mkdir -p $(DEST)/lib $(DEST)/include
|
|
install runtime/extism.h $(DEST)/include/extism.h
|
|
install target/release/libextism.$(SOEXT) $(DEST)/lib/libextism.$(SOEXT)
|
|
|
|
uninstall:
|
|
rm -f $(DEST)/include/extism.h $(DEST)/lib/libextism.$(SOEXT)
|
|
|
|
|