#!/bin/csh # # $Id: Makefile,v 1.1 2011/09/27 17:22:20 jlang Exp $ # # $Log: Makefile,v $ # Revision 1.1 2011/09/27 17:22:20 jlang # Added bounding shape example # # Revision 1.6 2010/09/29 14:28:59 jlang # Separate files for line_segment and point2d. Added test_point and make label test # # Revision 1.5 2008/09/15 18:45:14 jlang # Fixed makefile to create exe # # Revision 1.4 2008/09/15 18:24:13 jlang # Replaced makedepend by gcc # # Revision 1.3 2008/09/15 18:20:18 jlang # *** empty log message *** # # Revision 1.2 2008/09/15 18:19:36 jlang # Added makefile # CXX = g++ ifndef OSTYPE OSTYPE=cygnus # OSTYPE=linux-gnu endif ifeq ($(OSTYPE),linux-gnu) INCDIR = LDLIBDIR = # -L/usr/X11R6/lib LDLIBS = # -lglut -lGLU -lGL -lm # -lglui else LDLIBS = # -lglut32 -lglu32 -lopengl32 -lm # -lglui endif .PHONY: all clean SRC = fitting.cpp aa_box.cpp point2d.cpp SRC_TEST = test_point.cpp point2d.cpp # Default build : all: dependencies intersect test: test_dependencies ptTest dependencies: $(SRC:%.cpp=%.d) $(SRC:%.c=%.d) test_dependencies: $(SRC_TEST:%.cpp=%.d) $(SRC_TEST:%.c=%.d) # sed line based on John Graham-Cumming, Dependency Management, # Dr.Dobb's Portal, Apr 01, 2006. %.d:%.cpp $(CXX) $(INCDIR) -MG -MM $< | sed 's,\($*\.o\)[ :]*\(.*\), $@ : $$\(wildcard \2\)\n\1 : \2,g' > $@ -include $(SRC:.cpp=.d) -include $(SRC_TEST:.cpp=.d) intersect: $(SRC:%.cpp=%.o) $(CXX) $(LDLIBDIR) -o $@ $^ $(LDLIBS) ptTest: $(SRC_TEST:%.cpp=%.o) $(CXX) $(LDLIBDIR) -o $@ $^ $(LDLIBS) %.o:%.c $(CC) $(INCDIR) -c $*.c -o $@ %.o:%.cpp $(CXX) $(INCDIR) -c $*.cpp -o $@ clean: rm -f *~ *.o *.d