forked from bytecodealliance/wasm-micro-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aos.mk
133 lines (114 loc) · 4.72 KB
/
aos.mk
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
NAME := iwasm
CORE_ROOT := wamr/core
IWASM_ROOT := wamr/core/iwasm
SHARED_ROOT := wamr/core/shared
GLOBAL_DEFINES += BH_MALLOC=wasm_runtime_malloc
GLOBAL_DEFINES += BH_FREE=wasm_runtime_free
# Change it to THUMBV7M if you want to build for developerkit
WAMR_BUILD_TARGET := X86_32
WAMR_BUILD_PLATFORM := alios-things
ifeq (${WAMR_BUILD_TARGET}, X86_32)
GLOBAL_DEFINES += BUILD_TARGET_X86_32
INVOKE_NATIVE := invokeNative_ia32.s
AOT_RELOC := aot_reloc_x86_32.c
else ifeq (${WAMR_BUILD_TARGET}, X86_64)
GLOBAL_DEFINES += BUILD_TARGET_X86_64
INVOKE_NATIVE := invokeNative_em64.s
AOT_RELOC := aot_reloc_x86_64.c
else ifeq ($(findstring ARM,$(WAMR_BUILD_TARGET)), ARM)
GLOBAL_DEFINES += BUILD_TARGET_ARM
GLOBAL_DEFINES += BUILD_TARGET=\"$(WAMR_BUILD_TARGET)\"
INVOKE_NATIVE := invokeNative_arm.s
AOT_RELOC := aot_reloc_arm.c
else ifeq ($(findstring THUMB,$(WAMR_BUILD_TARGET)), THUMB)
GLOBAL_DEFINES += BUILD_TARGET_THUMB
GLOBAL_DEFINES += BUILD_TARGET=\"$(WAMR_BUILD_TARGET)\"
INVOKE_NATIVE := invokeNative_thumb.s
AOT_RELOC := aot_reloc_thumb.c
else ifeq (${WAMR_BUILD_TARGET}, MIPS)
GLOBAL_DEFINES += BUILD_TARGET_MIPS
INVOKE_NATIVE := invokeNative_mips.s
AOT_RELOC := aot_reloc_mips.c
else ifeq (${WAMR_BUILD_TARGET}, XTENSA)
GLOBAL_DEFINES += BUILD_TARGET_XTENSA
INVOKE_NATIVE := invokeNative_xtensa.s
AOT_RELOC := aot_reloc_xtensa.c
else
$(error Build target isn't set)
endif
# Enable Interpreter by default.
WAMR_BUILD_INTERP = 1
# Enable AOT by default.
WAMR_BUILD_AOT = 1
# Override the global heap usage
ifndef WAMR_BUILD_GLOBAL_HEAP_POOL
WAMR_BUILD_GLOBAL_HEAP_POOL=1
endif
GLOBAL_DEFINES += WASM_ENABLE_GLOBAL_HEAP_POOL=${WAMR_BUILD_GLOBAL_HEAP_POOL}
# Override the global heap size for small devices
ifndef WAMR_BUILD_GLOBAL_HEAP_SIZE
WAMR_BUILD_GLOBAL_HEAP_SIZE = 262144 # 256 kB
endif
GLOBAL_DEFINES += WASM_GLOBAL_HEAP_SIZE=${WAMR_BUILD_GLOBAL_HEAP_SIZE}
ifeq (${WAMR_BUILD_INTERP}, 1)
GLOBAL_DEFINES += WASM_ENABLE_INTERP=1
endif
ifeq (${WAMR_BUILD_AOT}, 1)
GLOBAL_DEFINES += WASM_ENABLE_AOT=1
endif
GLOBAL_DEFINES += WASM_ENABLE_LIBC_BUILTIN=1
GLOBAL_INCLUDES += ${CORE_ROOT} \
${IWASM_ROOT}/include \
${IWASM_ROOT}/common \
${SHARED_ROOT}/include \
${SHARED_ROOT}/platform/include \
${SHARED_ROOT}/utils \
${SHARED_ROOT}/mem-alloc \
${SHARED_ROOT}/platform/alios
ifeq (${WAMR_BUILD_INTERP}, 1)
GLOBAL_INCLUDES += ${IWASM_ROOT}/interpreter
endif
ifeq (${WAMR_BUILD_AOT}, 1)
GLOBAL_INCLUDES += ${IWASM_ROOT}/aot
endif
$(NAME)_SOURCES := ${SHARED_ROOT}/platform/alios/alios_platform.c \
${SHARED_ROOT}/platform/alios/alios_thread.c \
${SHARED_ROOT}/platform/alios/alios_time.c \
${SHARED_ROOT}/platform/common/math/math.c \
${SHARED_ROOT}/mem-alloc/mem_alloc.c \
${SHARED_ROOT}/mem-alloc/ems/ems_kfc.c \
${SHARED_ROOT}/mem-alloc/ems/ems_alloc.c \
${SHARED_ROOT}/mem-alloc/ems/ems_hmu.c \
${SHARED_ROOT}/utils/bh_assert.c \
${SHARED_ROOT}/utils/bh_bitmap.c \
${SHARED_ROOT}/utils/bh_common.c \
${SHARED_ROOT}/utils/bh_hashmap.c \
${SHARED_ROOT}/utils/bh_list.c \
${SHARED_ROOT}/utils/bh_leb128.c \
${SHARED_ROOT}/utils/bh_log.c \
${SHARED_ROOT}/utils/bh_queue.c \
${SHARED_ROOT}/utils/bh_vector.c \
${SHARED_ROOT}/utils/runtime_timer.c \
${IWASM_ROOT}/libraries/libc-builtin/libc_builtin_wrapper.c \
${IWASM_ROOT}/common/wasm_application.c \
${IWASM_ROOT}/common/wasm_runtime_common.c \
${IWASM_ROOT}/common/wasm_native.c \
${IWASM_ROOT}/common/wasm_exec_env.c \
${IWASM_ROOT}/common/wasm_loader_common.c \
${IWASM_ROOT}/common/wasm_memory.c \
${IWASM_ROOT}/common/wasm_c_api.c \
${IWASM_ROOT}/common/arch/${INVOKE_NATIVE} \
src/main.c
ifeq (${WAMR_BUILD_INTERP}, 1)
$(NAME)_SOURCES += ${IWASM_ROOT}/interpreter/wasm_interp_classic.c \
${IWASM_ROOT}/interpreter/wasm_loader.c \
${IWASM_ROOT}/interpreter/wasm_runtime.c
endif
ifeq (${WAMR_BUILD_AOT}, 1)
$(NAME)_SOURCES += ${IWASM_ROOT}/aot/aot_loader.c \
${IWASM_ROOT}/aot/arch/${AOT_RELOC} \
${IWASM_ROOT}/aot/aot_runtime.c \
${IWASM_ROOT}/aot/aot_intrinsic.c
endif