# SAMPLE Makefile for project 1 # You are not required to use this makefile PROJ = Proj1 CC = g++ CCFLAGS = -g -ansi -Wall -I . SOURCES = \ Proj1.cpp \ Point.cpp \ Point.h \ Circle.cpp \ Circle.h \ Rectangle.cpp \ Rectangle.h \ DisplayObject.cpp \ DisplayObject.h \ Raster.cpp \ Raster.h OBJECTS = Proj1.o Point.o Circle.o Rectangle.o Raster.o # The big daddy compilation rule. Links all the objects. $(PROJ): $(OBJECTS) $(CC) $(CCFLAGS) -o $(PROJ) $(OBJECTS) # The following rules make (compile) the various object files ################ Proj1.o: Proj1.cpp $(CC) $(CCFLAGS) -c Proj1.cpp Point.o: Point.cpp Point.h $(CC) $(CCFLAGS) -c Point.cpp Circle.o: Circle.cpp Circle.h $(CC) $(CCFLAGS) -c Circle.cpp Rectangle.o: Rectangle.cpp Rectangle.h $(CC) $(CCFLAGS) -c Rectangle.cpp Raster.o: Raster.cpp Raster.h $(CC) $(CCFLAGS) -c Raster.cpp ################ # Utility for printing the code you have written for the project. # Typing 'make print' produces a PostScript file named $(PROJ).ps # to be printed on an appropriate PS printer such as acsps. PRINTPGM = a2ps PRINTFLAGS = -nP PRINTFILE = $(PROJ).ps .PHONY: print print: $(SOURCES) - $(PRINTPGM) $(PRINTFLAGS) $(SOURCES) Makefile > $(PRINTFILE) # Utility for printing all the code -- both the code you have written # and the code that was provided for the project. # Typing 'make printall' produces a PostScript file named $(PROJ).ps # to be printed on an appropriate PS printer such as acsps. .PHONY: printall printall: $(SOURCES) $(PROVIDED_SOURCES) - $(PRINTPGM) $(PRINTFLAGS) \ $(SOURCES) $(PROVIDED_SOURCES) Makefile > $(PRINTFILE) # Utility for submitting your files. Typing 'make submit' # submits the files for you. # SUBMITCLASS should be the same for all sections of 341 SUBMITCLASS = cs341 .PHONY: submit submit: submit $(SUBMITCLASS) $(PROJ) $(SOURCES) Makefile # Utilities for cleaning up your directory. # 'make clean' removes emacs backup files # 'make cleaner' also removes all object files # 'make cleanest' also removes core and the executable .PHONY: clean .PHONY: cleaner .PHONY: cleanest clean: - rm -f *# *~ cleaner: clean - rm -f *.o cleanest: cleaner - rm -f core; rm -f $(PROJ)