all: testPerson polymorphism testInheritance 

testPerson: testPerson.cpp person.o
	clang++ --std=c++11 -g testPerson.cpp person.o -o testPerson

polymorphism:  polymorphism.cpp person.o student.o professor.o
	clang++ --std=c++11 -g polymorphism.cpp person.o student.o professor.o -o polymorphism

testInheritance:  testInheritance.cpp person.o student.o professor.o
	clang++ --std=c++11 -g testInheritance.cpp person.o student.o \
	    professor.o -o testInheritance

person.o: person.cpp
	clang++ --std=c++11 -g -c person.cpp

student.o: student.cpp student.h
	clang++ --std=c++11 -g -c student.cpp

professor.o: professor.cpp professor.h
	clang++ --std=c++11 -g -c professor.cpp

clean:
	rm -f *.o testPerson polymorphism testInheritance 
