jumpartifact.com_demo_0/wasm_build/Makefile

72 lines
1.7 KiB
Makefile
Raw Normal View History

ifdef RELEASE
OTHER_FLAGS = -DNDEBUG -O3
else
2023-08-18 05:51:53 +00:00
OTHER_FLAGS = -Og
endif
OBJDIR = objdir
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 \
../src/surface_triangle.cc \
../src/screen_walker_hack.cc \
../src/electricity_effect.cc \
../src/spark_effect.cc \
../src/common_constants.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 \
../src/surface_triangle.h \
../src/screen_walker_hack.h \
../src/electricity_effect.h \
../src/spark_effect.h \
../src/common_constants.h
OBJECTS = $(addprefix ${OBJDIR}/,$(subst ..,PREVDIR,$(subst .cc,.cc.o,${SOURCES})))
CXX = source ${HOME}/git/emsdk/emsdk_env.sh &>/dev/null && em++
all: | format jumpartifact.com_demo_0.html
jumpartifact.com_demo_0.html: ${OBJECTS} ${HEADERS}
2023-08-04 05:32:05 +00:00
${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 \
2023-08-04 05:32:05 +00:00
--preload-file ../res \
${OTHER_FLAGS} \
${OBJECTS}
.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
rm -rf "${OBJDIR}"
format:
2023-07-30 12:43:18 +00:00
clang-format -i --style=google ${SOURCES} ${HEADERS}
.SECONDEXPANSION:
${OBJDIR}/%.cc.o: $$(subst PREVDIR,..,%.cc) ${HEADERS}
2023-08-18 06:23:50 +00:00
@mkdir -p "$(dir $@)"
${CXX} -std=c++20 -I../wasm_include -c ${OTHER_FLAGS} -o $@ $<