35 lines
694 B
Makefile
35 lines
694 B
Makefile
OBJS= \
|
|
build/src/main.o \
|
|
build/src/Map.o \
|
|
build/src/Game.o \
|
|
build/src/Arrow.o \
|
|
build/src/Player.o \
|
|
build/src/GameRenderer.o
|
|
|
|
MAKEFLAGS += -j $(shell nproc)
|
|
|
|
CXX_FLAGS = -std=c++23 -Wall -Wextra -Wpedantic -Wconversion -pedantic -pedantic-errors
|
|
|
|
RELEASE=0
|
|
|
|
ifeq ($(RELEASE), 1)
|
|
CXX_FLAGS += -Werror
|
|
else
|
|
CXX_FLAGS += -fsanitize=address,undefined
|
|
LINKER_FLAGS += -fsanitize=address,undefined
|
|
endif
|
|
|
|
CXX_FLAGS += $(shell pkg-config sdl2 SDL2_image --cflags)
|
|
LINKER_FLAGS += $(shell pkg-config sdl2 SDL2_image --libs)
|
|
|
|
build/%.o: %.cpp $(wildcard *.hpp)
|
|
@mkdir -p `dirname $@`
|
|
g++ $(CXX_FLAGS) -c -o $@ $<
|
|
|
|
all: $(OBJS)
|
|
g++ $(OBJS) $(LINKER_FLAGS)
|
|
|
|
clean:
|
|
rm -r build
|
|
rm a.out
|