2020-07-27 16:58:43 +00:00
|
|
|
CXX ?= g++
|
|
|
|
CFLAGS ?= -O2 -Wall -Wextra -g
|
|
|
|
PREFIX ?= /usr/local/bin
|
2020-08-22 11:17:56 +00:00
|
|
|
LDFLAGS ?= -lSDL2 -lSDL2_image -lSDL2_gfx -lSDL2_ttf -pthread
|
2020-07-27 16:58:43 +00:00
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
default: demo
|
|
|
|
|
|
|
|
demo: main.o sdlpp.o
|
|
|
|
$(CXX) $(CFLAGS) -o $@ $^ ${LDFLAGS}
|
2020-08-22 23:15:46 +00:00
|
|
|
tetris: tetris.o sdlpp.o
|
|
|
|
$(CXX) $(CFLAGS) -o $@ $^ ${LDFLAGS}
|
2020-07-27 16:58:43 +00:00
|
|
|
test: test.o sdlpp.o
|
|
|
|
$(CXX) $(CFLAGS) -o $@ $^ ${LDFLAGS}
|
|
|
|
|
|
|
|
main.o: main.cpp sdlpp.hpp
|
2020-09-11 12:24:54 +00:00
|
|
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
2020-07-27 16:58:43 +00:00
|
|
|
sdlpp.o: sdlpp.cpp sdlpp.hpp
|
2020-09-11 12:24:54 +00:00
|
|
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
2020-07-27 16:58:43 +00:00
|
|
|
test.o: tests/test.cpp sdlpp.hpp tests/catch.hpp
|
2020-09-11 12:24:54 +00:00
|
|
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
2020-08-23 07:47:47 +00:00
|
|
|
tetris.o: tetris.cpp sdlpp.hpp
|
2020-09-11 12:24:54 +00:00
|
|
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
2020-07-27 16:58:43 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -Rf *.o test demo
|