# Makefile to compile and run every example from the book # With SmallEiffel, the environment variable SmallEiffel must be defined, # and command 'compile' should be in the PATH # You can alternatively use ISE Eiffel directly in each subdir, except in a few# cases where portability issues have not been dealt with yet. # Note: this Makefile is recursively called from subdirs SUBDIRCODE = creation/* struct/* behavior/* EiffelSources = $(shell ls *.e) all: here=`pwd`; for dir in $(SUBDIRCODE) ; \ do cd $${dir}; $(MAKE) execution; cd $${here}; done execution: output.txt ace: Ace.ace Ace.ace: ../../Ace.ace if [ -r root_class ]; \ then r=`cat root_class`;sed "s/main (/$$r (/" ../../Ace.ace>Ace.ace;\ else cp ../../Ace.ace . ; \ fi output.txt: main if [ -x run ]; then cat run; run; else main > $@ ; fi main: $(EiffelSources) if [ -r root_class ]; \ then compile -clean `cat root_class` -o main ; \ else compile -clean main -o main ; \ fi clean: rm -fr main *.[cho] a.out appli output.txt allclean: rm -fr `find . \( -name output.txt -o -name 'main*.[cho]' \ -o -name 'main' -o -name '*~' -o -name 'a.out' \ -o -name 'EIFGEN' \) -print`