jumpartifact.com_demo_0/Makefile

70 lines
1.4 KiB
Makefile
Raw Normal View History

ifdef DEBUG
2023-08-18 05:51:53 +00:00
COMMON_FLAGS = -g -Og
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
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 \
2023-08-07 03:54:23 +00:00
src/raymath.cc \
src/ems.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/game.h \
src/screen.h \
src/screen_test.h \
src/screen_trunner.h \
2023-08-07 03:54:23 +00:00
src/3d_helpers.h \
src/ems.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
2023-07-30 12:43:18 +00:00
OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${SOURCES}))
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
demo_0: ${OBJECTS}
2023-07-30 12:46:07 +00:00
${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
2023-07-30 12:43:18 +00:00
format:
clang-format -i --style=google ${HEADERS} ${SOURCES} ${TEST_SOURCES}
${OBJDIR}/%.cc.o: %.cc ${HEADERS}
@mkdir -p $(dir $@)
${CXX} -c ${CXX_FLAGS} -o $@ $<