CXXFLAGS= -Wall -g -std=c++0x 
OBJECTS=RedBlackTreeFactory.o br_tree.o br_node.o main.o
EXE=main
all: $(EXE)

$(EXE): $(OBJECTS)
	$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@
test: test.cpp RedBlackTreeFactory.o br_node.o 
rtest: test
	./test
RedBlackTreeFactory.o: RedBlackTreeFactory.cpp RedBlackTreeFactory.h
br_node.o: br_node.cpp br_node.h
br_tree.o: br_tree.cpp br_tree.h
main.o: main.cpp

run: main
	./main

clean:
	@rm -vf *.o
	@rm -vf $(EXE)
	@rm -vf *.1
	@rm -vf *.0
	@rm -vf test
	@rm -rvf *.dSYM

drun: main
	gdb ./main

valgrind: $(EXE)
	valgrind --tool=memcheck --leak-check=yes ./$(EXE)
