CXX = g++ CFLAGS = -Wall -g ifeq ($(shell uname), Darwin) LIBS = -framework GLUT -framework OpenGL -framework Cocoa else LIBS = -lglut -lGL -lGLU endif FREEGLUT = /afs/nd.edu/user37/ccl/software/external/freeglut ifneq "$(wildcard $(FREEGLUT))" "" INCPATH = -I$(FREEGLUT)/include LIBPATH = -L$(FREEGLUT)/lib endif all: spaceship clean: rm -f *.o spaceship depend: rm -f Makefile.back mv Makefile Makefile.bak sed '/^# DEPENDENCIES/,$$d' Makefile.bak > Makefile echo '# DEPENDENCIES' >> Makefile $(CXX) -MM *.cc *.c >> Makefile .c.o: $(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $< .cc.o: $(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $< .cpp.o: $(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $< spaceship: spaceship.o ppm.o capture.o $(CXX) $(CFLAGS) $(INCPATH) -o $@ $^ $(LIBPATH) $(LIBS) # DEPENDENCIES spaceship.o: spaceship.cc capture.h capture.o: capture.c capture.h ppm.h ppm.o: ppm.c ppm.h