# makefile for BRDF viewer, SGI version

# XFORMS is path to get Xforms.
# on graphics lab SGI's,
# xforms comes from /usr/local/include/forms.h and /usr/local/lib/libforms.so
XFORMS = /usr/local

# PUB is path to get VL.
# We get Andrew Willmott's simple version of VL from $(PUB)/{include/svl,lib}.
# use relative path if possible
#PUB = ../..
# else use absolute path
PUB = /afs/cs/project/classes-ph/860/pub

IPATH = -I$(XFORMS)/include -I$(PUB)/include/svl
LIBS = -L$(XFORMS)/lib -lforms -L$(PUB)/lib -lVLd -lGLU -lGL -lX11 -lm -lcomplex

C++ = CC

# We don't define VL_TEMPLATE or VL_FLOAT
# because we want non-templated doubles in our vectors and matrices.
# For optimization on SGI's, use -O2 -mips2
# For debugging, use -g -DVL_CHECKING
C++FLAGS = -O2 -mips2 $(IPATH)
#C++FLAGS = -g2 -DVL_CHECKING -mips2 $(IPATH)

OBJ = brdfview.o ui_form.o glxf.o phong.o cook_torrance.o oren-nayar.o \
		heBRDF.o

.C.o:
	$(C++) -c $(C++FLAGS) $<

brdfview: $(OBJ)
	$(C++) $(C++FLAGS) -o brdfview $(OBJ) $(LIBS)

phongtest: phong.C illum.o
	$(C++) $(C++FLAGS) -DPHONGTEST -o phongtest phong.C illum.o $(LIBS)

clean:
	-rm -rf core brdfview phongtest ii_files *.o *~ "#"*"#"

brdfview.o: brdfview.H glxf.H ui_form.H \
    illum.H phong.H cook_torrance.H oren-nayar.H
ui_form.o: ui_form.H
glxf.o: glxf.H

illum.o: illum.H
phong.o: illum.H phong.H
cook_torrance.o: illum.H cook_torrance.H
oren-nayar.o: illum.H oren-nayar.H
