CXX ?= g++
CXXFLAGS = -W -Wall -Wno-unused-result -O2 -I algorithms -I mazetypes -I maze \
	-std=c++11

all: mazegen

clean:
	@echo "Cleaning"
	@rm -f $(OBJECTS) mazegen ../mazegen

OBJECTS = \
	algorithms/breadthfirstsearch.o algorithms/depthfirstsearch.o \
	algorithms/kruskal.o algorithms/looperasedrandomwalk.o \
	algorithms/spanningtreealgorithm.o algorithms/prim.o \
	mazetypes/rectangularmaze.o \
	maze/cellborder.o  maze/maze.o \
	mazefeld.o main.o

mazegen: $(OBJECTS)
	@echo "Building" $@
	@$(CXX) -o $@ $(OBJECTS) $(CXXFLAGS)
	@cp mazegen ../

mazefeld.o: mazefeld.c
	$(CC) -W -Wall -O2 -c mazefeld.c

%.o: %.cpp
	@echo "Compiling" $<
	@$(CXX) -o $@ -c $< $(CXXFLAGS)

