# 1) To use this Makefile you'll need to enter the details below (especially # the source files). # # 2) To ask the compiler to work out which of your source files depends on # which other source files you need to 'make depend'. # You need to do a 'make depend' whenever you add new files to the source or # when you include new headers in your code, thereby changing which files # depend on which other files. # After you've done a 'make depend' open this Makefile in vi and have a look # to see what happened. (Don't change anything after the line at the bottom though!) # # 3) You can do a plain 'make' to build your application # # File updated by Alan Dorin, April 2000 # the compiler you want to use CC=gcc # the options to send to the compiler CFLAGS=-g # the name of your output executable file OUT_FILE_NAME=myProject # the location of GL headers GL_DIR=/usr/include/GL # the libraries LIBS= -lGL -lglut -lGLU -lm # the suffixes to the files in your code .SUFFIXES: .C .c .h .o # enter the names of your source files.... SRC = \ cls_fred.C cls_tom.C \ cls_marianne.C cls_melanie.C all: $(OUT_FILE_NAME) $(OUT_FILE_NAME) : cls_fred.o cls_tom.o \ cls_marianne.o cls_melanie.o $(CC) $(CFLAGS) -o $(OUT_FILE_NAME) \ cls_fred.o cls_tom.o \ cls_marianne.o cls_melanie.o \ -I$(GL_DIR) \ $(LIBS) .C.o : $(CC) $(CFLAGS) -c $< .c.o : $(CC) $(CFLAGS) -c $< depend: $(SRC) @echo -n "Backing up Makefile, " @mv -f Makefile Makefile.bak @awk '/^\#Do not remove/{n = 1;print $0} n==0' Makefile.bak >Makefile @echo "now making dependencies" @gcc -MM $(SRC) >> Makefile #Do not remove this line because it will break without it. Also, DON'T change beneath this line.