CXX=g++
CPPFLAGS=-Wall -g -std=c++0x
SOURCES=main.cc menu.cc person.cc people.cc
OBJECTS=$(SOURCES:.cc=.o)
EXE=app

all: $(EXE)

main.o: main.cc person.o people.o menu.o
menu.o: menu.h menu.cc
person.o: person.cc person.h
people.o: people.cc people.h

$(EXE): $(OBJECTS)
	$(CXX) $(LDFLAGS) $(OBJECTS) -o $@


clean:
	@rm -vf *.o
	@rm -rvf *.dSYM
	@rm -vf app


run: $(EXE)
	./$(EXE)

test: $(EXE)
	./$(EXE) < test.txt

debug: $(EXE)
	gdb $(EXE)

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

autov: $(EXE)
	valgrind --tool=memcheck --leak-check=yes ./$(EXE) < test.txt
