aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile15
1 files changed, 12 insertions, 3 deletions
diff --git a/makefile b/makefile
index e4d27fd..4262cfa 100644
--- a/makefile
+++ b/makefile
@@ -99,6 +99,7 @@ debug: export BIN_PATH := bin/debug
99shared: export BUILD_PATH := build/shared 99shared: export BUILD_PATH := build/shared
100shared: export BIN_PATH := bin/shared 100shared: export BIN_PATH := bin/shared
101install: export BIN_PATH := bin/release 101install: export BIN_PATH := bin/release
102wasm: export BIN_PATH := bin/release
102 103
103# Find all source files in the source directory, sorted by most 104# Find all source files in the source directory, sorted by most
104# recently modified 105# recently modified
@@ -116,8 +117,10 @@ ifeq ($(SOURCES),)
116 SOURCES := $(call rwildcard, $(SRC_PATH), *.$(SRC_EXT)) 117 SOURCES := $(call rwildcard, $(SRC_PATH), *.$(SRC_EXT))
117endif 118endif
118 119
120SOURCES := $(filter-out ./src/yue_wasm.cpp, $(SOURCES))
121
119ifeq ($(NO_LUA),true) 122ifeq ($(NO_LUA),true)
120 SOURCES := $(filter-out ./src/yuescript/yue.cpp, $(SOURCES)) 123 SOURCES := $(filter-out ./src/yuescript/yuescript.cpp, $(SOURCES))
121endif 124endif
122 125
123# Set the object file names, with the source directory stripped 126# Set the object file names, with the source directory stripped
@@ -176,13 +179,19 @@ else
176 @echo "Beginning release build" 179 @echo "Beginning release build"
177endif 180endif
178ifneq ($(NO_LUA),true) 181ifneq ($(NO_LUA),true)
179 @$(MAKE) -C ./src/lua 182 @$(MAKE) generic -C ./src/lua
180endif 183endif
181 @$(START_TIME) 184 @$(START_TIME)
182 @$(MAKE) all --no-print-directory 185 @$(MAKE) all --no-print-directory
183 @echo -n "Total build time: " 186 @echo -n "Total build time: "
184 @$(END_TIME) 187 @$(END_TIME)
185 188
189.PHONY: wasm
190wasm:
191 @$(MAKE) generic CC='emcc -s WASM=1' AR='emar rcu' RANLIB='emranlib' -C ./src/lua
192 @mkdir -p doc/docs/.vuepress/public/js
193 @emcc src/yue_wasm.cpp src/yuescript/ast.cpp src/yuescript/parser.cpp src/yuescript/yue_compiler.cpp src/yuescript/yue_parser.cpp src/yuescript/yuescript.cpp src/lua/liblua.a -s WASM=1 -O2 -o doc/docs/.vuepress/public/js/yuescript.js -Isrc -Isrc/lua -std=c++17 --bind -fexceptions
194
186# Debug build for gdb debugging 195# Debug build for gdb debugging
187.PHONY: debug 196.PHONY: debug
188debug: dirs 197debug: dirs
@@ -192,7 +201,7 @@ else
192 @echo "Beginning debug build" 201 @echo "Beginning debug build"
193endif 202endif
194ifneq ($(NO_LUA),true) 203ifneq ($(NO_LUA),true)
195 @$(MAKE) -C ./src/lua 204 @$(MAKE) generic -C ./src/lua
196endif 205endif
197 @$(START_TIME) 206 @$(START_TIME)
198 @$(MAKE) all --no-print-directory 207 @$(MAKE) all --no-print-directory