Stephen Seo
0611be13f2
All checks were successful
Build and Publish WASM version of demo / Build-And-Deploy (push) Successful in 15s
.SECONDEXPANSION is not necessary.
59 lines
1.1 KiB
Makefile
59 lines
1.1 KiB
Makefile
ifdef DEBUG
|
|
COMMON_FLAGS = -g -O0
|
|
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
|
|
|
|
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
|
|
|
|
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 $@ $<
|