diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-04-16 17:25:39 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-04-16 17:25:39 +0800 |
| commit | ce9f6632635222b38ef0b37b4b1273da4a1877b4 (patch) | |
| tree | 04d4d3ea81749989015434333d3db1add7b0195a /makefile | |
| parent | 3355b7c475bc4a3bc8c4f2e8a2f504bb3ccb9395 (diff) | |
| download | yuescript-ce9f6632635222b38ef0b37b4b1273da4a1877b4.tar.gz yuescript-ce9f6632635222b38ef0b37b4b1273da4a1877b4.tar.bz2 yuescript-ce9f6632635222b38ef0b37b4b1273da4a1877b4.zip | |
fix small issues, add web assembly support.
Diffstat (limited to 'makefile')
| -rw-r--r-- | makefile | 15 |
1 files changed, 12 insertions, 3 deletions
| @@ -99,6 +99,7 @@ debug: export BIN_PATH := bin/debug | |||
| 99 | shared: export BUILD_PATH := build/shared | 99 | shared: export BUILD_PATH := build/shared |
| 100 | shared: export BIN_PATH := bin/shared | 100 | shared: export BIN_PATH := bin/shared |
| 101 | install: export BIN_PATH := bin/release | 101 | install: export BIN_PATH := bin/release |
| 102 | wasm: 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)) |
| 117 | endif | 118 | endif |
| 118 | 119 | ||
| 120 | SOURCES := $(filter-out ./src/yue_wasm.cpp, $(SOURCES)) | ||
| 121 | |||
| 119 | ifeq ($(NO_LUA),true) | 122 | ifeq ($(NO_LUA),true) |
| 120 | SOURCES := $(filter-out ./src/yuescript/yue.cpp, $(SOURCES)) | 123 | SOURCES := $(filter-out ./src/yuescript/yuescript.cpp, $(SOURCES)) |
| 121 | endif | 124 | endif |
| 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" |
| 177 | endif | 180 | endif |
| 178 | ifneq ($(NO_LUA),true) | 181 | ifneq ($(NO_LUA),true) |
| 179 | @$(MAKE) -C ./src/lua | 182 | @$(MAKE) generic -C ./src/lua |
| 180 | endif | 183 | endif |
| 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 | ||
| 190 | wasm: | ||
| 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 |
| 188 | debug: dirs | 197 | debug: dirs |
| @@ -192,7 +201,7 @@ else | |||
| 192 | @echo "Beginning debug build" | 201 | @echo "Beginning debug build" |
| 193 | endif | 202 | endif |
| 194 | ifneq ($(NO_LUA),true) | 203 | ifneq ($(NO_LUA),true) |
| 195 | @$(MAKE) -C ./src/lua | 204 | @$(MAKE) generic -C ./src/lua |
| 196 | endif | 205 | endif |
| 197 | @$(START_TIME) | 206 | @$(START_TIME) |
| 198 | @$(MAKE) all --no-print-directory | 207 | @$(MAKE) all --no-print-directory |
