CC=g++
DEV=-Wall -g -std=c++14
OPT=-O3 -std=c++14

JSON=json.hpp

.PHONY: all
all: AVLSanityCheck Test bstTest
#all: BSTSanityCheck CreateData AVLSanityCheck Test

#CreateData: CreateData.cxx json.hpp
#	$(CC) $(OPT) CreateData.cxx -o CreateData.exe

#BSTSanityCheck: BSTSanityCheck.cxx BST.o
#	$(CC) $(DEV) BSTSanityCheck.cxx BST.o -o BSTSanityCheck.exe

AVLSanityCheck: AVLSanityCheck.cxx AVLCommands.o
	$(CC) $(DEV) AVLSanityCheck.cxx AVLCommands.o -o AVLSanityCheck.exe

Test: test.cpp AVLCommands.o
	$(CC) $(DEV) test.cpp AVLCommands.o -o Test.exe

bstTest: bstTest.cpp BST.o
	$(CC) $(DEV) bstTest.cpp BST.o -o bstTest.exe

BST.o: BST.cpp BST.h
	$(CC) $(DEV) -c BST.cpp

AVLCommands.o: AVLCommands.cpp AVLCommands.h
	$(CC) $(DEV) -c AVLCommands.cpp

# Build
.PHONY: clean
clean:
	rm -f *.o
	rm -f *.exe
	rm -f *.h.gch
	rm -rf *dSYM

.PHONY: update
update:
	make clean
	make all
