# Makefile avec variables automatiques

CXX = g++
CXXFLAGS = -g -Wall -std=c++11
OFILES = fruits.o persons.o eatFruit.o

all: eatFruit

fruits.o   :  fruits.cc fruits.h
	$(CXX) $(CXXFLAGS) -c $< -o $@

persons.o  :  persons.cc persons.h fruits.h
	$(CXX) $(CXXFLAGS) -c $< -o $@

eatFruit.o :  eatFruit.cc fruits.h persons.h
	$(CXX) $(CXXFLAGS) -c $< -o $@

eatFruit   : $(OFILES)
	$(CXX) $(OFILES) -o $@

clean:
	@echo " *** EFFACE MODULES OBJET ET EXECUTABLE ***"
	@/bin/rm -f *.o *.x *.cc~ *.h~ eatFruit
