CXX=g++ CFLAGS = -Wall -g -std=c++11 SUBDIRS = 02-stockClasses 03-stockClassesVirtuals EXES = 00-goodcons 01-badcons 04-baddestruct 05-slicing 06-unsliced 07-abstract all: ${EXES} ${SUBDIRS} $(EXES): %:%.o -$(CXX) $(CFLAGS) $@.cc -o $@ .PHONY: ${SUBDIRS} ${SUBDIRS}: $(MAKE) -C $@ %.o: %.cc -$(CXX) $(CFLAGS) -c $< .PHONY: clean clean: rm -f *.o *~ $(EXES) @for dir in ${SUBDIRS}; do \ $(MAKE) -C $$dir clean; \ done FORCE: