diff --git a/.gitignore b/.gitignore index 0f304fa..32466fa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ *.o demo test -tetris +tetris/tetris diff --git a/Makefile b/Makefile index dad3b6c..8765d45 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,6 @@ 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} @@ -19,8 +17,6 @@ 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 diff --git a/tetris/Makefile b/tetris/Makefile new file mode 100644 index 0000000..f38f576 --- /dev/null +++ b/tetris/Makefile @@ -0,0 +1,18 @@ +CXX ?= g++ +CFLAGS ?= -O2 -Wall -Wextra -g +PREFIX ?= /usr/local/bin +LDFLAGS ?= -lSDL2 -lSDL2_image -lSDL2_gfx -lSDL2_ttf -pthread + +.PHONY: default +default: tetris + +tetris: tetris.o sdlpp.o + $(CXX) $(CFLAGS) -o $@ $^ ${LDFLAGS} + +sdlpp.o: ../sdlpp.cpp ../sdlpp.hpp + $(CXX) $(CFLAGS) -c -o $@ $< +tetris.o: tetris.cpp ../sdlpp.hpp + $(CXX) $(CFLAGS) -c -o $@ $< + +clean: + rm -Rf *.o tetris diff --git a/tetris/testfont.ttf b/tetris/testfont.ttf new file mode 100644 index 0000000..2b6392f Binary files /dev/null and b/tetris/testfont.ttf differ diff --git a/tetris.cpp b/tetris/tetris.cpp similarity index 99% rename from tetris.cpp rename to tetris/tetris.cpp index f56b324..ab30eea 100644 --- a/tetris.cpp +++ b/tetris/tetris.cpp @@ -1,4 +1,4 @@ -#include "sdlpp.hpp" +#include "../sdlpp.hpp" #include #include #include