jumpartifact.com_demo_0/wasm_build/Makefile
Stephen Seo d4188f29b1
All checks were successful
Build and Publish WASM version of demo / Build-And-Deploy (push) Successful in 17s
Use -Og instead of -O0 in Debug builds
2023-08-18 14:51:53 +09:00

50 lines
1.1 KiB
Makefile

ifdef RELEASE
OTHER_FLAGS = -DNDEBUG -O3
else
OTHER_FLAGS = -Og
endif
SOURCES = \
../src/main.cc \
../src/ems.cc \
../src/game.cc \
../src/screen.cc \
../src/screen_test.cc \
../src/screen_trunner.cc \
../src/3d_helpers.cc \
../src/raymath.cc \
../src/walker.cc
HEADERS = \
../src/ems.h \
../src/game.h \
../src/screen.h \
../src/screen_test.h \
../src/screen_trunner.h \
../src/3d_helpers.h \
../src/walker.h
CXX = source ${HOME}/git/emsdk/emsdk_env.sh && em++
all: | format jumpartifact.com_demo_0.html
jumpartifact.com_demo_0.html: ${SOURCES} ${HEADERS}
${CXX} -std=c++20 -o jumpartifact.com_demo_0.html \
-s USE_GLFW=3 -I../wasm_include -L../wasm_lib -lraylib \
--shell-file custom_shell.html \
-sEXPORTED_FUNCTIONS=_main \
-sEXPORTED_RUNTIME_METHODS=ccall \
--preload-file ../res \
${OTHER_FLAGS} \
${SOURCES}
.PHONY: clean format
clean:
rm -f jumpartifact.com_demo_0.html
rm -f jumpartifact.com_demo_0.js
rm -f jumpartifact.com_demo_0.wasm
rm -f jumpartifact.com_demo_0.data
format:
clang-format -i --style=google ${SOURCES} ${HEADERS}