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: demo clean: rm -f *.o demo depend: rm -f Makefile.back mv Makefile Makefile.bak sed '/^# DEPENDENCIES/,$$d' Makefile.bak > Makefile echo '# DEPENDENCIES' >> Makefile $(CXX) -MM *.cc >> Makefile .c.o: $(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $< .cc.o: $(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $< .cpp.o: $(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $< demo: main.o drawable_circle.o drawable_star.o drawable_initials.o color.o utils.o $(CXX) $(CFLAGS) $(INCPATH) -o $@ $^ $(LIBPATH) $(LIBS) # DEPENDENCIES color.o: color.cc color.h drawable_circle.o: drawable_circle.cc drawable_circle.h drawable.h \ color.h point.h utils.h drawable_initials.o: drawable_initials.cc drawable_initials.h drawable.h \ color.h point.h utils.h drawable_star.o: drawable_star.cc drawable_star.h drawable.h color.h \ point.h main.o: main.cc drawable.h color.h point.h drawable_circle.h \ drawable_star.h drawable_initials.h utils.o: utils.cc utils.h