forked from extism/extism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (29 loc) · 798 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
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)