# This sample Makefile allows you to make a OpenGL application # whose source is exactly one .c or .cc file. # # To use this Makefile, you must type: # # make xxxx # # where xxxx.c or xxxx.cc is the name of the file you wish to compile # This Makefile works because the default makefile rules include several # magic variables that are used during processing, like this: # $(CC) $(CFLAGS) $(CPPFLAGS) # $(CXX) $(CXXFLAGS) $(CPPFLAGS) # Therefore, all we really need to do is define some variables. This is # really cool! # Makefile written by Scott D. Anderson # simplified from the main Makefile # November 2007 # OSTYPE is not set by default on Mac OS X or on Linux. Should end up # being "linux" and "darwin," respectively ifndef OSTYPE OSTYPE = $(shell uname -s|awk '{print tolower($$0)}') endif ifeq ($(OSTYPE),linux) CFLAGS = -g -I/usr/X11R6/include/ CXXFLAGS = $(CFLAGS) LDLIBS = -L/usr/X11R6/lib -lglut -lGL -lGLU -lXmu -lXi -lX11 -lm endif ifeq ($(OSTYPE),darwin) CFLAGS = -g -I/usr/X11R6/include/ -DMAC CXXFLAGS = $(CFLAGS) LDLIBS = -lm -framework OpenGL -framework cocoa -framework glut endif