jumpartifact.com_demo_0/Makefile
Stephen Seo d7d1d4d7a0
All checks were successful
Build and Publish WASM version of demo / Build-And-Deploy (push) Successful in 21s
Impl. "hacking" a "Walker"
The "hack" is to press a button in a time limit after clicking on a
Walker's head. If successful, the player can control the Walker. On
failure, nothing happens.
2023-08-23 16:37:26 +09:00

63 lines
1.2 KiB
Makefile

ifdef DEBUG
COMMON_FLAGS = -g -Og
else
COMMON_FLAGS = -DNDEBUG -O3
endif
CXX_FLAGS = -Wall -Wextra -Wpedantic -Weffc++ ${COMMON_FLAGS} -std=c++20
LINKER_FLAGS = -lraylib
OBJDIR = objdir
SOURCES = \
src/main.cc \
src/game.cc \
src/screen.cc \
src/screen_test.cc \
src/screen_trunner.cc \
src/3d_helpers.cc \
src/raymath.cc \
src/ems.cc \
src/walker.cc \
src/surface_triangle.cc \
src/screen_walker_hack.cc
HEADERS = \
src/game.h \
src/screen.h \
src/screen_test.h \
src/screen_trunner.h \
src/3d_helpers.h \
src/ems.h \
src/walker.h \
src/surface_triangle.h\
src/screen_walker_hack.h
OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${SOURCES}))
TEST_SOURCES = \
src/test/test.cc
TEST_OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${TEST_SOURCES}))
all: | format demo_0
demo_0: ${OBJECTS}
${CXX} ${CXX_FLAGS} ${LINKER_FLAGS} -o $@ $^
test: $(filter-out ${OBJDIR}/src/main.cc.o,${OBJECTS}) ${TEST_OBJECTS}
${CXX} ${CXX_FLAGS} ${LINKER_FLAGS} -o $@ $^
.PHONY: clean format
clean:
rm -rf ${OBJDIR}
rm -f demo_0
rm -f test
format:
clang-format -i --style=google ${HEADERS} ${SOURCES} ${TEST_SOURCES}
${OBJDIR}/%.cc.o: %.cc ${HEADERS}
@mkdir -p $(dir $@)
${CXX} -c ${CXX_FLAGS} -o $@ $<