include ../opengl-dir.mk

PROG	= barycentric
CFLAGS	= -w -s -O2 -ansi -DSHM
XLIBS	= -lX11 -lXext -lXmu -lXext -lXmu -lXt -lXi -lSM -lICE
LIBS	= -lglut -lGLU -lGL  
INCLS	= -I/usr/X11R/include  -I$(TOP)/include  -I../12
LIBDIR	= -L/usr/X11/lib -L/usr/X11R6/lib -L$(TOP)/lib

#source codes
SRCS = $(PROG).cpp

#substitute .cpp by .o to obtain object filenames
OBJS = $(SRCS:.cpp=.o) 
OBJS1 = ../12/Point3.o  ../12/XYZ.o ../12/Vector3.o
#$< evaluates to the target's dependencies, 
#$@ evaluates to the target

$(PROG): $(OBJS) $(OBJS1)
	g++ -o $@ $(OBJS) $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS) 
	g++ -o bezcurve bezcurve.cpp $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS) $(INCLS)  
	g++ -o bezsurface bezsurface.cpp $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS) $(INCLS)   
	g++ -o bspline bspline.cpp $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS) $(INCLS)   
	g++ -o nurbsurface nurbsurface.cpp $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS) $(INCLS)   
	g++ -o polyint polyint.cpp $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS)  $(INCLS)  
	g++ -o  subdivision  subdivision.cpp $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS) $(INCLS)   
	g++ -o  subdivision1  subdivision1.cpp $(OBJS1) $(LIBDIR) $(LIBS) $(XLIBS) $(INCLS)  

$(OBJS): 
	g++ -c  $*.cpp $(INCLS) 

$(OBJS1): 
	cd ../12;  g++ -c  $*.cpp $(INCLS); cd ../13; 

clean:
	rm *.o $(PROG); rm bezcurve bezsurface bspline nurbsurface polyint subdivision subdivision1

