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