2023-07-30 12:34:38 +00:00
|
|
|
ifdef RELEASE
|
|
|
|
OTHER_FLAGS = -DNDEBUG -O3
|
|
|
|
else
|
|
|
|
OTHER_FLAGS = -O0
|
|
|
|
endif
|
|
|
|
|
|
|
|
SOURCES = \
|
|
|
|
../src/main.cc \
|
2023-07-31 06:01:51 +00:00
|
|
|
../src/ems.cc \
|
2023-07-31 07:27:01 +00:00
|
|
|
../src/game.cc \
|
|
|
|
../src/screen.cc \
|
2023-08-02 10:59:06 +00:00
|
|
|
../src/screen_test.cc \
|
|
|
|
../src/screen_trunner.cc \
|
|
|
|
../src/3d_helpers.cc
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
HEADERS = \
|
2023-07-31 06:01:51 +00:00
|
|
|
../src/ems.h \
|
2023-07-31 07:27:01 +00:00
|
|
|
../src/game.h \
|
|
|
|
../src/screen.h \
|
2023-08-02 10:59:06 +00:00
|
|
|
../src/screen_test.h \
|
|
|
|
../src/screen_trunner.h \
|
|
|
|
../src/3d_helpers.h
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
CXX = source ${HOME}/git/emsdk/emsdk_env.sh && em++
|
|
|
|
|
|
|
|
all: | format jumpartifact.com_demo_0.html
|
|
|
|
|
|
|
|
jumpartifact.com_demo_0.html: ${SOURCES} ${HEADERS}
|
|
|
|
${CXX} -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 \
|
|
|
|
${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:
|
2023-07-30 12:43:18 +00:00
|
|
|
clang-format -i --style=google ${SOURCES} ${HEADERS}
|