# The C compiler to use. CC= gcc CFLAGS= -Wall -g # Note that the -lglut may need to be changed to -lfreeglut if you are using # a version of freeglut that is different. LDFLAGS= -lglut -lGLU -lGL # This is done so that the existence of a file named "clean" won't confuse # make. .PHONY: clean ############### # Build rules # ############### # by default, make will run this target as it is the first one listed. # Having an "all" target is especially handy if your makefile needs to build # multiple programs. all: first # type "make clean" when you want to force a complete rebuild of your project. clean: -rm -f *.o first # "make first" will build just the first program. first: first.o $(CC) $(LDFLAGS) $(CFLAGS) -o first first.o first.o: first.c $(CC) $(CFLAGS) -c -o first.o first.c