2023-07-30 12:34:38 +00:00
|
|
|
ifdef DEBUG
|
2023-08-18 05:51:53 +00:00
|
|
|
COMMON_FLAGS = -g -Og
|
2023-07-30 12:34:38 +00:00
|
|
|
else
|
|
|
|
COMMON_FLAGS = -DNDEBUG -O3
|
|
|
|
endif
|
|
|
|
|
2023-08-04 05:32:05 +00:00
|
|
|
CXX_FLAGS = -Wall -Wextra -Wpedantic -Weffc++ ${COMMON_FLAGS} -std=c++20
|
2023-07-30 12:34:38 +00:00
|
|
|
LINKER_FLAGS = -lraylib
|
|
|
|
|
|
|
|
OBJDIR = objdir
|
|
|
|
|
|
|
|
SOURCES = \
|
2023-07-31 06:01:51 +00:00
|
|
|
src/main.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-07 03:54:23 +00:00
|
|
|
src/raymath.cc \
|
2023-08-10 04:28:45 +00:00
|
|
|
src/ems.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
|
|
|
|
2023-07-31 06:01:51 +00:00
|
|
|
HEADERS = \
|
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-07 03:54:23 +00:00
|
|
|
src/3d_helpers.h \
|
2023-08-10 04:28:45 +00:00
|
|
|
src/ems.h \
|
2023-08-21 05:37:50 +00:00
|
|
|
src/walker.h \
|
2023-08-24 04:53:57 +00:00
|
|
|
src/surface_triangle.h \
|
|
|
|
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:43:18 +00:00
|
|
|
|
2023-07-30 12:34:38 +00:00
|
|
|
OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${SOURCES}))
|
|
|
|
|
2023-08-02 10:59:06 +00:00
|
|
|
TEST_SOURCES = \
|
|
|
|
src/test/test.cc
|
|
|
|
|
|
|
|
TEST_OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${TEST_SOURCES}))
|
|
|
|
|
2023-07-30 12:43:18 +00:00
|
|
|
all: | format demo_0
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
demo_0: ${OBJECTS}
|
2023-07-30 12:46:07 +00:00
|
|
|
${CXX} ${CXX_FLAGS} ${LINKER_FLAGS} -o $@ $^
|
2023-07-30 12:34:38 +00:00
|
|
|
|
2023-08-02 10:59:06 +00:00
|
|
|
test: $(filter-out ${OBJDIR}/src/main.cc.o,${OBJECTS}) ${TEST_OBJECTS}
|
|
|
|
${CXX} ${CXX_FLAGS} ${LINKER_FLAGS} -o $@ $^
|
|
|
|
|
2023-07-30 12:34:38 +00:00
|
|
|
.PHONY: clean format
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf ${OBJDIR}
|
|
|
|
rm -f demo_0
|
2023-08-02 10:59:06 +00:00
|
|
|
rm -f test
|
2023-07-30 12:34:38 +00:00
|
|
|
|
2023-07-30 12:43:18 +00:00
|
|
|
format:
|
2023-08-04 02:42:11 +00:00
|
|
|
clang-format -i --style=google ${HEADERS} ${SOURCES} ${TEST_SOURCES}
|
2023-07-30 12:34:38 +00:00
|
|
|
|
2023-08-10 07:34:27 +00:00
|
|
|
${OBJDIR}/%.cc.o: %.cc ${HEADERS}
|
2023-07-30 12:34:38 +00:00
|
|
|
@mkdir -p $(dir $@)
|
2023-07-31 06:01:51 +00:00
|
|
|
${CXX} -c ${CXX_FLAGS} -o $@ $<
|