2023-07-30 12:34:38 +00:00
|
|
|
ifdef DEBUG
|
|
|
|
COMMON_FLAGS = -g -O0
|
|
|
|
else
|
|
|
|
COMMON_FLAGS = -DNDEBUG -O3
|
|
|
|
endif
|
|
|
|
|
|
|
|
CXX_FLAGS = -Wall -Wextra -Wpedantic -Weffc++ ${COMMON_FLAGS}
|
|
|
|
LINKER_FLAGS = -lraylib
|
|
|
|
|
|
|
|
OBJDIR = objdir
|
|
|
|
|
|
|
|
SOURCES = \
|
|
|
|
src/main.cc
|
|
|
|
|
2023-07-30 12:43:18 +00:00
|
|
|
HEADERS =
|
|
|
|
|
2023-07-30 12:34:38 +00:00
|
|
|
OBJECTS = $(addprefix ${OBJDIR}/,$(subst .cc,.cc.o,${SOURCES}))
|
|
|
|
|
2023-07-30 12:43:18 +00:00
|
|
|
all: | format demo_0
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
demo_0: ${OBJECTS}
|
|
|
|
${CXX} -o demo_0 ${LINKER_FLAGS} $^
|
|
|
|
|
|
|
|
.PHONY: clean format
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf ${OBJDIR}
|
|
|
|
rm -f demo_0
|
|
|
|
|
2023-07-30 12:43:18 +00:00
|
|
|
format:
|
|
|
|
clang-format -i --style=google ${HEADERS} ${SOURCES}
|
2023-07-30 12:34:38 +00:00
|
|
|
|
|
|
|
${OBJDIR}/%.cc.o: %.cc
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
${CXX} -c ${CXX_FLAGS} -o $@ $^
|