# set compiler used for builing program CC = gcc # gnu options GCCOPTS = -Wall -ansi -g # sun options CCOPTS = # options for c compiler COPTS = $(GCCOPTS) # suffice of executable #SUFFIX = exe SUFFIX = out main.o: stack.h main.c $(CC) -c $(COPTS) main.c main2.o: stack_with_delete.h main2.c $(CC) -c $(COPTS) main2.c stack.o: stack.h stack.c $(CC) -c $(COPTS) stack.c array_stack.o: stack.h array_stack.c $(CC) -c $(COPTS) array_stack.c list_stack.o: stack.h list_stack.c $(CC) -c $(COPTS) list_stack.c newstack_arr.o: stack.h newstack_arr.c $(CC) -c $(COPTS) newstack_arr.c newstack_list.o: stack.h newstack_list.c $(CC) -c $(COPTS) newstack_list.c # make the test with an array_stack a.$(SUFFIX): main.o stack.o array_stack.o $(CC) main.o stack.o array_stack.o # make the test with a list_stack a2.$(SUFFIX): main.o stack.o list_stack.o $(CC) -o a2.$(SUFFIX) main.o stack.o list_stack.o a3.$(SUFFIX): main2.o array_stack_without_newstack.o \ stack_with_delete.c \ list_stack_without_newstack.o $(NEWSTACK).o $(CC) $(COPTS) -o a3.$(SUFFIX) main2.o \ array_stack_without_newstack.o \ list_stack_without_newstack.c \ stack_with_delete.c \ $(NEWSTACK).o clean: /bin/rm -f *.o a.$(SUFFIX) a2.$(SUFFIX) a3.$(SUFFIX) *.ps *.exe all: a.$(SUFFIX) a2.$(SUFFIX) a3.$(SUFFIX) echo "Done!" main.ps: main.c a2ps -v --columns=1 -f 18 --no-header --borders no \ --landscape --output=main.ps main.c stack.ps: stack.h stack.c a2ps -v --columns=1 -f 15 --no-header --borders no \ --landscape --output=stack.ps stack.h stack.c array_stack.ps: array_stack.c a2ps -v --columns=1 -f 16 --no-header --borders no \ --landscape --output=array_stack.ps array_stack.c list_stack.ps: list_stack.c a2ps -v --columns=1 -f 16 --no-header --borders no \ --landscape --output=list_stack.ps list_stack.c highlight: ../../C++Examples/make_hl_html array_stack.c c ../ ../../C++Examples/make_hl_html array_stack_without_newstack.c c ../ ../../C++Examples/make_hl_html newstack_arr.c c ../ ../../C++Examples/make_hl_html list_stack.c c ../ ../../C++Examples/make_hl_html list_stack_without_newstack.c c ../ ../../C++Examples/make_hl_html newstack_list.c c ../ ../../C++Examples/make_hl_html main.c c ../ ../../C++Examples/make_hl_html main2.c c ../ ../../C++Examples/make_hl_html stack.c c ../ ../../C++Examples/make_hl_html stack.h c ../ ../../C++Examples/make_hl_html stack_with_delete.h c ../ ../../C++Examples/make_hl_html stack_with_delete.c c ../ ../../C++Examples/make_hl_html Makefile Makefile ../ index.html: array_stack.c array_stack.c.html array_stack_without_newstack.c array_stack_without_newstack.c.html list_stack.c list_stack.c.html list_stack_without_newstack.c list_stack_without_newstack.c.html main.c main.c.html main2.c main2.c.html Makefile stack.c stack.c.html stack.h stack.h.html stack_with_delete.h stack_with_delete.h.html ls -C1 | ../../C++Examples/makefilelist > index.html