#
# Makefile for raypaint
#
# Craig Kolb
#
# \$Id: Makefile.SH,v 4.0 91/07/17 14:48:38 kolb Exp Locker: kolb $
#
# Bin directory
#
BINDIR = /usr/local
#
# 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 = OPTIMIZE
URTINC = 
CCFLAGS = CPU=68040 NOSTKCHK MATH=68881 IGNORE=85+100+161+154+84+132+104\
STRMERGE DATA=AUTO DEFINE=malloc=stupid_malloc DEFINE=free=stupid_free\
DEFINE=exit=myexit
URTLIB = LIB:rle.lib
LDFLAGS = SC SD ND NOICONS DEFINE ___main=___nowbmain
CC = sc
MKDEP = /mkdep
YACC = bison -y

LIBRAYDIR = /libray
LIBSHADEDIR = /libshade
INCLUDE = IDIR=$(LIBRAYDIR) IDIR=$(LIBRAYDIR)/libcommon\
IDIR=$(LIBRAYDIR)/libobj IDIR=$(LIBRAYDIR)/libsurf IDIR=$(LIBSHADEDIR)\
IDIR=/ $(URTINC)
YFLAGS = -d

#
# If using X11, use:
#GRAPHICSLIB = -lX11

#
# If you are using GL, use:
#GRAPHICSLIB = -lgl_s

LIBRAY = $(LIBRAYDIR)/ray.lib
LIBSHADE = $(LIBSHADEDIR)/shade.lib

CFLAGS = $(CCFLAGS) $(URTINC) $(INCLUDE) $(OPTIMIZE) DEFINE=SHARED_EDGES
SHELL = /bin/sh

#
# If you are using a Multimax, add -lpp
# If you have a fast malloc library, use it (e.g., -lmalloc on MIPS machines)
#
LIBS = $(LIBSHADE) $(LIBRAY) /libextra/extra.lib LIB:rle.lib LIB:unix.lib\
LIB:fl.lib LIB:scm881.lib LIB:sc.lib

DRIVE_C =	main.c amigraphics.c render.c version.c

DRIVE_O = main.o amigraphics.o render.o version.o

CFILES = $(DRIVE_C)

SHFILES = Makefile.SH

OBJ = $(DRIVE_O)

DEPENDSRC = $(DRIVE_C)

raypaint: $(OBJ)
	slink FROM LIB:c.o $(OBJ) TO raypaint $(LDFLAGS) LIB $(LIBS)

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

#
# End of configuration section
#
install:	raypaint
		mv raypaint $(BINDIR)/raypaint

clean:
	Delete $(OBJ) QUIET

realclean:
	rm -f $(OBJ) core y.tab.h
	rm -f *.orig 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
main.o : main.c
main.o : /libshade/rayshade.h
main.o : /libray/libobj/geom.h
main.o : /libray/libcommon/common.h
main.o : /config.h
main.o : /libray/libcommon/expr.h
main.o : /libray/libcommon/vector.h
main.o : /libray/libcommon/ray.h
main.o : /libray/libcommon/color.h
main.o : /libray/libcommon/transform.h
main.o : /libray/libcommon/error.h
main.o : /libray/libobj/bounds.h
main.o : /libshade/funcdefs.h
main.o : /libshade/options.h
main.o : /libshade/stats.h
main.o : /libshade/viewing.h
main.o : /libshade/picture.h
render.o : render.c
render.o : /libshade/rayshade.h
render.o : /libray/libobj/geom.h
render.o : /libray/libcommon/common.h
render.o : /config.h
render.o : /libray/libcommon/expr.h
render.o : /libray/libcommon/vector.h
render.o : /libray/libcommon/ray.h
render.o : /libray/libcommon/color.h
render.o : /libray/libcommon/transform.h
render.o : /libray/libcommon/error.h
render.o : /libray/libobj/bounds.h
render.o : /libshade/funcdefs.h
render.o : /libray/libcommon/sampling.h
render.o : /libray/libsurf/atmosphere.h
render.o : /libshade/viewing.h
render.o : /libshade/options.h
render.o : /libshade/stats.h
render.o : /libshade/picture.h
version.o : version.c
version.o : /libshade/rayshade.h
version.o : /libray/libobj/geom.h
version.o : /libray/libcommon/common.h
version.o : /config.h
version.o : /libray/libcommon/expr.h
version.o : /libray/libcommon/vector.h
version.o : /libray/libcommon/ray.h
version.o: /libray/libcommon/color.h
version.o: /libray/libcommon/transform.h
version.o: /libray/libcommon/error.h
version.o : /libray/libobj/bounds.h
version.o : /libshade/funcdefs.h
version.o : /patchlevel.h
version.o : /libshade/stats.h
