# This is a simple makefile that compiles multiple C++ source files # set the names here to be the names of your source files with the # .cxx or .cpp replaced by .o # Be *** SURE *** to put the .o files here rather than the source files ProjectObjects = theProject.o class1.o class2.o OtherProjectObjects = other.o #------------ no need to change between these lines ------------------- CFLAGS = -g -Wall .SUFFIXES: .cxx .cpp .cxx.o: g++ $(CFLAGS) -c $< .cpp.o: g++ $(CFLAGS) -c $< #------------ no need to change between these lines ------------------- #------------ targets -------------------------------------------- # describe how to create the targets - often there will be only one target all: theProject other theProject: $(ProjectObjects) g++ $(CFLAGS) $(ProjectObjects) -o theProject other: $(OtherProjectObjects) g++ $(CFLAGS) $(OtherProjectObjects) -o other clean: rm -f $(ProjectObjects) $(OtherProjectObjects) theProject other #------------ dependencies -------------------------------------------- # put the .o that depends on a .h, then colon, then TAB, then the .h class1.o: class1.h class2.o: class2.h theProject.o: class1.h class2.h