forked from permaweb/HyperBEAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (64 loc) · 1.69 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.PHONY: compile
compile:
rebar3 compile
WAMR_VERSION = 2.1.2
WAMR_DIR = _build/wamr
# commented out to remove NFR blocking commits
# GITHOOKS_DIR = .githooks
ifdef HB_DEBUG
WAMR_FLAGS = -DWAMR_ENABLE_LOG=1 -DWAMR_BUILD_DUMP_CALL_STACK=1 -DCMAKE_BUILD_TYPE=Debug
else
WAMR_FLAGS = -DCMAKE_BUILD_TYPE=Release
endif
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Darwin)
WAMR_BUILD_PLATFORM = darwin
ifeq ($(UNAME_M),arm64)
WAMR_BUILD_TARGET = AARCH64
else
WAMR_BUILD_TARGET = X86_64
endif
else
WAMR_BUILD_PLATFORM = linux
WAMR_BUILD_TARGET = X86_64
endif
# githooks: $(GITHOOKS_DIR)/_/setup
wamr: $(WAMR_DIR)/lib/libvmlib.a
debug: debug-clean $(WAMR_DIR)
HB_DEBUG=1 make $(WAMR_DIR)/lib/libvmlib.a
CFLAGS="-DHB_DEBUG=1" rebar3 compile
debug-clean:
rm -rf priv
rm -rf $(WAMR_DIR)
# Clone the WAMR repository at our target release
$(WAMR_DIR):
git clone \
https://github.com/bytecodealliance/wasm-micro-runtime.git \
$(WAMR_DIR) \
-b WAMR-$(WAMR_VERSION) \
--single-branch
$(WAMR_DIR)/lib/libvmlib.a: $(WAMR_DIR)
cmake \
$(WAMR_FLAGS) \
-S $(WAMR_DIR) \
-B $(WAMR_DIR)/lib \
-DWAMR_BUILD_TARGET=$(WAMR_BUILD_TARGET) \
-DWAMR_BUILD_PLATFORM=$(WAMR_BUILD_PLATFORM) \
-DWAMR_BUILD_LIBC_WASI=0 \
-DWAMR_BUILD_MEMORY64=1 \
-DWAMR_DISABLE_HW_BOUND_CHECK=1 \
-DWAMR_BUILD_EXCE_HANDLING=1 \
-DWAMR_BUILD_SHARED_MEMORY=0 \
-DWAMR_BUILD_AOT=0 \
-DWAMR_BUILD_FAST_INTERP=0 \
-DWAMR_BUILD_INTERP=1 \
-DWAMR_BUILD_JIT=0
make -C $(WAMR_DIR)/lib
# $(GITHOOKS_DIR)/_/setup:
# @sh ./$(GITHOOKS_DIR)/_/install.sh
clean:
rebar3 clean
# Add a new target to print the library path
print-lib-path:
@echo $(CURDIR)/lib/libvmlib.a