# The reason why this makefile does not work properly is because # Arraystack.cc and Linkstack.cc generate no code. Thus, although # all the modules compile, the final linking stage fails. # To correct this problem you must move Arraystack.cc into Astack.h # and similarly for Linkstack.cc # This failure illustrates the difficulty of hiding template methods from # users of template classes. In a sense this is OK, since the intent # of classes is to build sharable libraries of objects. # Of course there are other reasons why this example is not so good, # particularly the fact that Reverse.cc does not implement properly # a member function of the Stack class. This is corrected in Vstack.cc # Tony Marsland, Professor all: Arraystack.o Linkstack.o Reverse.o Main.o g++ *.o -o stack Arraystack.o: Arraystack.cc Astack.h Vstack.h g++ -Wall -ansi -c Arraystack.cc Linkstack.o: Linkstack.cc Lstack.h Vstack.h g++ -Wall -ansi -c Linkstack.cc Reverse.o: Reverse.cc Vstack.h g++ -Wall -ansi -c Reverse.cc Main.o: Main.cc Vstack.h g++ -Wall -ansi -c Main.cc clean: rm stack *.o total: TotalStack.cc g++ -Wall -ansi -o stack TotalStack.cc