#
# Makefile for rayview 
#
# Craig Kolb
#
# $Id: Makefile.SH,v 4.0 91/07/17 14:55:03 kolb Exp Locker: kolb $
#
# Bin directory
#
BINDIR = d:/rayshade/bin 
#
# If you are using LINDA, add -DLINDA
# If you are running on a Multimax, add -DMULTIMAX -DSHAREDMEM
# Be sure to add any necessary floating point hardware switches.
# 
OPTIMIZE = -off
URTINC = 
CCFLAGS = -exp -phar2  
URTLIB = 
LDFLAGS = -lm
CC = mcc
MKDEP = d:/rayshade/mkdep
YACC = bison -y

LIBRAYDIR = ../libray
LIBSHADEDIR = ../libshade
INCLUDES = -I$(LIBRAYDIR) -I$(LIBSHADEDIR) -I..
YFLAGS = -d

#
# If using GL on an SGI machine, use:
#GRAPHICSLIBS = -lsphere -lgl_s
#SPHERELIB = -DSPHERELIB

#
# If using GL on an RS6000, use:
#GRAPHICSLIBS = -lgl
#SPHERELIB=

#
# If using DJGPP
#GRAPHICSLIBS = -lgr
#SPHERELIB=

#
# If using MicroWay
#GRAPHICSLIBS = -lgrex
#SPHERELIB=

LIBRAY = $(LIBRAYDIR)/libray.lib
LIBSHADE = $(LIBSHADEDIR)/libshade.lib

CFLAGS = $(CCFLAGS) $(SPHERELIB) $(URTINC) $(INCLUDES) $(OPTIMIZE)
SHELL = command

#
# If you have a fast malloc library, use it (e.g., -lmalloc on MIPS machines)
#
LIBS = $(LIBSHADE) $(LIBRAY) $(URTLIB)

DRIVE_C =	main.c gl.c sphergen.c version.c

DRIVE_O = $(DRIVE_C:.c=.obj)

CFILES = $(DRIVE_C)

SHFILES = Makefile.SH

OBJ = $(DRIVE_O)

DEPENDSRC = $(DRIVE_C)

#
# Change $(CC) below to $(LCC) if using Linda.
#
rayview: $(OBJ) $(LIBS)
	$(CC) $(OPTIMIZE) -o rayview $(OBJ) $(GRAPHICSLIBS) $(LIBS) $(LDFLAGS)

#
# Uncomment the following rule if using Linda.
#
#raytrace.lo: raytrace.cl
#	$(LCC) $(CFLAGS) -c raytrace.cl

#
# End of configuration section
#
install: rayview	
	copy rayview $(BINDIR)
	del rayview

clean:
	for %i in ($(OBJ)) do del %i
	del core

realclean:
	for %i in ($(OBJ)) do del %i
	del core
	del y.tab.h
	del Makefile

lint:
	lint $(CFLAGS) -x $(CFILES) -lm

tags:
	ctags -t $(CFILES)

depend:
	(sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
	 $(MKDEP) $(DEPENDSRC) | sed 's/: \.\//: /; /\/usr\/include/d' \
	) >Makefile.new
	cp Makefile Makefile.bak
	cp Makefile.new Makefile
	rm -f Makefile.new


# DO NOT DELETE THIS LINE
