# Makefile # CMSC-341 Fall 2000 Project1 # Mitch Edelman # Created: 31 August 2000 # Current: 2 September 2000 # Thanks to Tom Anastasio for his original PROJ = Proj1 CC = CC CCFLAGS = -g -I. -I$(DIR1) -I$(DIR2) # Directory containing textbook code such as vector and string DIR1 = /afs/umbc.edu/users/e/d/edelman/pub/CMSC341 # Directory containing public code specifically for Project 1 DIR2 = /afs/umbc.edu/users/e/d/edelman/pub/CMSC341/Projects/Project1 # These are the files that students must write for this project. # They are to be submitted. SOURCES = \ Proj1_aux.H \ Proj1_aux.C \ Proj1.C # These are the files that have been provided to the students. # They are not to be submitted. PROVIDED_SOURCES = \ $(DIR1)/string.H \ $(DIR1)/string.C \ $(DIR1)/vector.H \ $(DIR1)/vector.C \ $(DIR2)/SetException.C \ $(DIR2)/SetException.H # These are the object files resulting from provided source code # as well as from student-written source code OBJECTS = \ Proj1.o \ Proj1_aux.o \ SetException.o \ Set.o \ string.o \ vector.o # The big daddy compilation rule. Links all the objects. $(PROJ): $(DIR2)/$(PROJ).C $(OBJECTS) $(CC) $(CCFLAGS) -o $(PROJ) $(OBJECTS) # The following rules make the various object files ################ Set.o: Set.C Set.H $(CC) $(CCFLAGS) -c Set.C SetException.o: $(DIR2)/SetException.C \ $(DIR2)/SetException.H $(CC) $(CCFLAGS) -c $(DIR2)/SetException.C Proj1.o: $(DIR2)/Proj1.C $(CC) $(CCFLAGS) -c $(DIR2)/Proj1.C Proj1_aux.o: Proj1_aux.C Proj1_aux.H $(CC) $(CCFLAGS) -c Proj1_aux.C string.o: $(DIR1)/string.C $(DIR1)/string.H $(CC) $(CCFLAGS) -c $(DIR1)/string.C vector.o: $(DIR1)/vector.C $(DIR1)/vector.H $(CC) $(CCFLAGS) -c $(DIR1)/vector.C ################ # 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. # Set SUBMITCLASS for your section. The following one is for # section 0201 (Mr. Edelman's section). SUBMITCLASS = cs341-02 .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, the executable, and # the ii_files directory created by the SGI compiler .PHONY: clean .PHONY: cleaner .PHONY: cleanest clean: - rm -f *# *~ cleaner: clean - rm -f *.o cleanest: cleaner - rm -f core; rm -f $(PROJ); rm -rf ii_files