# the next few lines prepare options based on whether this is a Linux or MacOS machine. # On MacOS, it's easiest to use the -framework compiler directive to access GL and GLUT # MACHINE= $(shell uname -s) ifeq ($(MACHINE),Linux) LINK_OPTIONS= -lglut -lGL -lGLU -lXmu -lX11 -lm else LINK_OPTIONS= -framework OpenGL -framework GLUT endif GCC_OPTIONS=-Wall -pedantic OPTIONS=$(GCC_OPTIONS) $(LINK_OPTIONS) .cpp: g++ $@.cpp $(OPTIONS) -o $@