From 626927fba4cee510ca49f7c8dfc58c0a3b8f321a Mon Sep 17 00:00:00 2001 From: zvon Date: Mon, 27 Jul 2020 18:58:43 +0200 Subject: [PATCH] Makefile and gitignore --- .gitignore | 5 +++++ Makefile | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..68c0d8f --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.png +*.bmp +*.o +demo +test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..29efa6a --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +CXX ?= g++ +CFLAGS ?= -O2 -Wall -Wextra -g +PREFIX ?= /usr/local/bin +LDFLAGS ?= -lSDL2 -lSDL2_image -lSDL2_gfx -pthread + +.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 + $(CXX) $(CFLAGS) -c -o $@ $< ${LDFLAGS} +sdlpp.o: sdlpp.cpp sdlpp.hpp + $(CXX) $(CFLAGS) -c -o $@ $< ${LDFLAGS} +test.o: tests/test.cpp sdlpp.hpp tests/catch.hpp + $(CXX) $(CFLAGS) -c -o $@ $< ${LDFLAGS} + +clean: + rm -Rf *.o test demo