game/Makefile
2020-09-11 14:24:54 +02:00

27 lines
629 B
Makefile

CXX ?= g++
CFLAGS ?= -O2 -Wall -Wextra -g
PREFIX ?= /usr/local/bin
LDFLAGS ?= -lSDL2 -lSDL2_image -lSDL2_gfx -lSDL2_ttf -pthread
.PHONY: default
default: demo
demo: main.o sdlpp.o
$(CXX) $(CFLAGS) -o $@ $^ ${LDFLAGS}
tetris: tetris.o sdlpp.o
$(CXX) $(CFLAGS) -o $@ $^ ${LDFLAGS}
test: test.o sdlpp.o
$(CXX) $(CFLAGS) -o $@ $^ ${LDFLAGS}
main.o: main.cpp sdlpp.hpp
$(CXX) $(CFLAGS) -c -o $@ $<
sdlpp.o: sdlpp.cpp sdlpp.hpp
$(CXX) $(CFLAGS) -c -o $@ $<
test.o: tests/test.cpp sdlpp.hpp tests/catch.hpp
$(CXX) $(CFLAGS) -c -o $@ $<
tetris.o: tetris.cpp sdlpp.hpp
$(CXX) $(CFLAGS) -c -o $@ $<
clean:
rm -Rf *.o test demo