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}
|
|
|
|
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-07-27 16:58:43 +00:00
|
|
|
|
2020-09-12 23:35:42 +00:00
|
|
|
windows_tetris: sdlpp.hpp sdlpp.cpp tetris/tetris.cpp tetris/config.cpp tetris/global_vars.cpp tetris/scenes.cpp tetris/functions.cpp tetris/config.hpp tetris/global_vars.hpp tetris/scenes.hpp tetris/functions.hpp
|
|
|
|
cl -MD -EHsc -Fe"Tetris" sdlpp.cpp tetris/tetris.cpp tetris/config.cpp tetris/global_vars.cpp tetris/scenes.cpp tetris/functions.cpp SDL2/SDL2_framerate.c SDL2/SDL2_gfxPrimitives.c SDL2/SDL2_imageFilter.c SDL2/SDL2_rotozoom.c /link SDL2.lib SDL2_ttf.lib SDL2_image.lib
|
|
|
|
|
2020-07-27 16:58:43 +00:00
|
|
|
clean:
|
|
|
|
rm -Rf *.o test demo
|