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 \
|
2023-08-21 05:37:50 +00:00
|
|
|
../src/walker.cc \
|
2023-08-23 07:37:26 +00:00
|
|
|
../src/surface_triangle.cc \
|
2023-08-24 04:53:57 +00:00
|
|
|
../src/screen_walker_hack.cc \
|
2023-08-25 04:07:38 +00:00
|
|
|
../src/electricity_effect.cc \
|
2023-08-31 06:26:24 +00:00
|
|
|
../src/spark_effect.cc \
|
|
|
|
../src/common_constants.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 \
|
2023-08-21 05:37:50 +00:00
|
|
|
../src/walker.h \
|
2023-08-23 07:37:26 +00:00
|
|
|
../src/surface_triangle.h \
|
2023-08-24 04:53:57 +00:00
|
|
|
../src/screen_walker_hack.h \
|
2023-08-25 04:07:38 +00:00
|
|
|
../src/electricity_effect.h \
|
2023-08-31 06:26:24 +00:00
|
|
|
../src/spark_effect.h \
|
|
|
|
../src/common_constants.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-12-12 07:24:09 +00:00
|
|
|
EMSDK_ENV_SH ?= ${HOME}/git/emsdk/emsdk_env.sh
|
|
|
|
|
|
|
|
CXX = source ${EMSDK_ENV_SH} &>/dev/null && em++
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
all: | format jumpartifact.com_demo_0.html
|
|
|
|
|
2023-12-12 07:18:25 +00:00
|
|
|
raylib/lib/libraylib.a raylib/include/raylib.h raylib/include/raymath.h:
|
2023-12-12 07:24:09 +00:00
|
|
|
../third_party_build/wasm_make_raylib.sh -o raylib -c raylib_git -e ${EMSDK_ENV_SH}
|
2023-12-12 07:18:25 +00:00
|
|
|
|
|
|
|
jumpartifact.com_demo_0.html: raylib/lib/libraylib.a raylib/include/raylib.h raylib/include/raymath.h ${OBJECTS} ${HEADERS}
|
2023-08-04 05:32:05 +00:00
|
|
|
${CXX} -std=c++20 -o jumpartifact.com_demo_0.html \
|
2023-12-12 07:18:25 +00:00
|
|
|
-s USE_GLFW=3 -Iraylib/include -Lraylib/lib -lraylib \
|
2023-07-30 12:34:38 +00:00
|
|
|
--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-12-12 07:18:25 +00:00
|
|
|
${CXX} -std=c++20 -Iraylib/include -c ${OTHER_FLAGS} -o $@ $<
|