# build noise test program # PNG library # I use the mac one from fink.sourceforge.net # must install libpng3 package, not just libpng3-shlibs PNGINC = -I/sw/include PNGLIB = -L/sw/lib -lpng # OpenGL libraries # note that on every other machine, GLUT and GL headers exist in a # directory named GL, so standard usage is to include GL/glut.h. On # Mac OS X, they're in an odd spot in a directory NOT named GL. Rather # than change every source file, I created a symbolic link with the # following commands. # sudo mkdir /usr/local/include # sudo ln -s /System/Library/Frameworks/GLUT/Headers /usr/local/include/GL GLINC = GLLIB = -framework GLUT -framework OpenGL -lobjc # flags for C++ compiler & linker CXXFLAGS = -g $(PNGINC) $(GLINC) LDLIBS = -g $(PNGLIB) $(GLLIB) # files and intermediate files we create OBJS = noise.o view.o motion.o key.o draw.o pngtex.o PROG = noise # rule for building # program from .o files $(PROG): $(OBJS) $(CXX) -o $(PROG) $(OBJS) $(LDFLAGS) $(LDLIBS) # any .o from .c uses built-in rule # remove everything but the program clean: rm -f *~ *.o # remove everything including program clobber: clean rm -f $(PROG)