Makefile and gitignore
This commit is contained in:
parent
3f61cd59ba
commit
626927fba4
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
*.png
|
||||||
|
*.bmp
|
||||||
|
*.o
|
||||||
|
demo
|
||||||
|
test
|
22
Makefile
Normal file
22
Makefile
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user