Add Makefile
This commit is contained in:
parent
a4754d03bb
commit
526512dbf8
1 changed files with 27 additions and 0 deletions
27
Makefile
Normal file
27
Makefile
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
CXX = g++
|
||||||
|
RM = rm
|
||||||
|
CXXFLAGS = $(shell sdl2-config --cflags)
|
||||||
|
LDLIBS = $(shell sdl2-config --libs) -lSDL2_image
|
||||||
|
|
||||||
|
SOURCES = $(wildcard src/*.cpp)
|
||||||
|
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
||||||
|
|
||||||
|
EXE = quadtree
|
||||||
|
|
||||||
|
%.cpp.o: src/%.cpp
|
||||||
|
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
||||||
|
|
||||||
|
main: CXXFLAGS += -O3
|
||||||
|
main: compilation
|
||||||
|
|
||||||
|
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g -Wold-style-cast -Wsign-conversion
|
||||||
|
dev: compilation
|
||||||
|
|
||||||
|
compilation: $(OBJETS)
|
||||||
|
$(CXX) -o $(EXE) $(OBJETS) $(LDLIBS)
|
||||||
|
|
||||||
|
all:
|
||||||
|
main
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) $(OBJETS) $(EXE)
|
Reference in a new issue