2023-07-30 12:34:38 +00:00
|
|
|
ifdef RELEASE
|
|
|
|
OTHER_FLAGS = -DNDEBUG -O3
|
|
|
|
else
|
2023-08-18 05:51:53 +00:00
|
|
|
OTHER_FLAGS = -Og
|
2023-07-30 12:34:38 +00:00
|
|
|
endif
|
|
|
|
|
2023-08-18 06:13:47 +00:00
|
|
|
OBJDIR = objdir
|
|
|
|
|
2023-07-30 12:34:38 +00:00
|
|
|
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 \
|
2023-08-04 02:42:11 +00:00
|
|
|
../src/3d_helpers.cc \
|
2023-08-10 04:28:45 +00:00
|
|
|
../src/raymath.cc \
|
|
|
|
../src/walker.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 \
|
2023-08-10 04:28:45 +00:00
|
|
|
../src/3d_helpers.h \
|
|
|
|
../src/walker.h
|
2023-07-30 12:34:38 +00:00
|
|
|
|
2023-08-18 06:13:47 +00:00
|
|
|
OBJECTS = $(addprefix ${OBJDIR}/,$(subst ..,PREVDIR,$(subst .cc,.cc.o,${SOURCES})))
|
|
|
|
|
2023-08-18 06:19:38 +00:00
|
|
|
CXX = source ${HOME}/git/emsdk/emsdk_env.sh &>/dev/null && em++
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
all: | format jumpartifact.com_demo_0.html
|
|
|
|
|
2023-08-18 06:13:47 +00:00
|
|
|
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 \
|
2023-07-30 12:34:38 +00:00
|
|
|
-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 \
|
2023-07-30 12:34:38 +00:00
|
|
|
${OTHER_FLAGS} \
|
2023-08-18 06:13:47 +00:00
|
|
|
${OBJECTS}
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
.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
|
2023-08-18 06:13:47 +00:00
|
|
|
rm -rf "${OBJDIR}"
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
format:
|
2023-07-30 12:43:18 +00:00
|
|
|
clang-format -i --style=google ${SOURCES} ${HEADERS}
|
2023-08-18 06:13:47 +00:00
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
|
|
|
|
${OBJDIR}/%.cc.o: $$(subst PREVDIR,..,%.cc) ${HEADERS}
|
2023-08-18 06:23:50 +00:00
|
|
|
@mkdir -p "$(dir $@)"
|
2023-08-18 06:13:47 +00:00
|
|
|
${CXX} -std=c++20 -I../wasm_include -c ${OTHER_FLAGS} -o $@ $<
|