# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $

MACHINE_DEFS=unix_defs.h
DEVLIBS=
ENV_CFLAGS=-O -DNO_SUB_PROTO
AR= ar rus
RANLIB= ranlib
FILETEST= test -r

DRAWCGM= /afs/psc.edu/@sys/usr/local/lib/libdrawcgm.a

ROOT_PATH = /afs/psc.edu/@sys/usr/local/p3d

INSTALL_PATH = $(ROOT_PATH)

LIB_INSTALL_PATH = $(ROOT_PATH)

COPTIONS = -I/afs/psc.edu/@sys/usr/local/include

LIBOPTIONS = -lm

CFLAGS= $(ENV_CFLAGS) $(COPTIONS)

IMAKEDIR= .././imakestuff
THISDIR= p3d/src

all::
	@echo " "
	@echo Making ALL in $(THISDIR)

#***************************************************************************
# Imakefile for P3D
# Copyright 1989, Pittsburgh Supercomputing Center, Carnegie Mellon University
# Authors Chris Nuuja and Joel Welling
#
# Permission use, copy, and modify this software and its documentation
# without fee for personal use or use within your organization is hereby
# granted, provided that the above copyright notice is preserved in all
# copies and that that copyright and this permission notice appear in
# supporting documentation.  Permission to redistribute this software to
# other organizations or individuals is not granted;  that must be
# negotiated with the PSC.  Neither the PSC nor Carnegie Mellon
# University make any representations about the suitability of this
# software for any purpose.  It is provided "as is" without express or
# implied warranty.
#
#***************************************************************************
# Installer should not have to change anything in this file
#---------------------------------------------------------------------+

SUBIMAKES= painter rayshade sgigl_utils

DUI=	/opt/demo/dui

DUI_LIBS= user_parse.o \
	$(DUI)/Render.o \
	$(DUI)/Dialbox.o\
	$(DUI)/Spaceball.o \
	$(DUI)/MkStudios.o \
	$(DUI)/Minivas.o \
	$(DUI)/ParseArg.o \
	$(DUI)/Ui.o \
	$(DUI)/PaintInstr.o \
	$(DUI)/Stop.o \
	$(DUI)/Butt.o \
	$(DUI)/Knobs.o \
	$(DUI)/MkModels.o \
	$(DUI)/Trnsfrmr.o

DORE=	/usr/lib/dore.o

PAINTER= painter/painter_ren.o painter/painter.o painter/painter_clip.o \
	painter/painter_util.o painter/paintr_trans.o

RAYSHADE= rayshade/ray_ren.o rayshade/setup.o rayshade/viewing.o \
	rayshade/object.o rayshade/bounds.o rayshade/voxels.o \
	rayshade/surface.o rayshade/raymath.o rayshade/matrix.o \
	rayshade/raytrace.o rayshade/intersect.o rayshade/grid.o \
	rayshade/cylinder.o rayshade/poly.o rayshade/memory.o \
	rayshade/sphere.o rayshade/triangle.o rayshade/shade.o \
	rayshade/light.o rayshade/outputp.o rayshade/list.o rayshade/box.o

GL_UTILS= sgigl_utils/knobs.o sgigl_utils/button.o sgigl_utils/slider.o \
	sgigl_utils/dialog.o

SUBMAKES= painter
RENDERER= $(PAINTER) $(DRAWCGM)

UI= mouse_ui.o motif_mi.o motif_view.o motif_flyby.o flyby.o

CONTROLLERS= tty.o dq.o lvr.o lvr_io.o

RENDER_DEFS=   -Dincp3d

ALISP = interp.o construct.o prims.o alisp_util.o env.o mem.o \
	lexer.o parse.o scan_token.o key.o ge_error.o alisp.o

P3D= render_ctrl.o matrix_ops.o p3d.o control.o assist.o assist_text.o \
	assist_spln.o assist_attr.o assist_nrml.o assist_mtrx.o \
	assist_colr.o material.o color.o vector.o point.o vertex.o \
	$(CONTROLLERS)

CSOURCE= alisp.c alisp_main.c alisp_util.c assist.c assist_attr.c \
	assist_colr.c assist_mtrx.c assist_nrml.c assist_spln.c assist_text.c \
	call_out.c construct.c control.c dore_ren.c dore_ui.c dphigs_ren.c \
	dq.c dump_ren.c env.c fui.c ge_error.c geom_spec.c indent.c interp.c \
	key.c kui.c lexer.c lvr.c lvr_io.c make_hershey.c matrix_ops.c mem.c \
	motif_mi.c mouse_ui.c p3d.c parse.c phigs_ren.c prims.c raydump_ren.c \
	render_ctrl.c rui.c scan_token.c sgigl_mi.c sgigl_ren.c sphigs_ren.c \
	syscall.c tdump_ren.c tty.c tui.c user_parse.c xview_mi.c material.c \
	art_ren.c rendermn_ren.c motif_view.c motif_flyby.c flyby.c \
	color.c vector.c point.c vertex.c

OTHER_SOURCE= hfonts.bin descrip.mms cc.opt data.button data.dial \
	data.explain

HFILES= alisp.h alisp_node.h assist.h control.h cylinder.h defs.h ge_error.h \
	hershey.h hfonts.h indent.h lvr_defines.h matrix_ops.h mi.h p3d.h \
	parse.h ren.h render_ctrl.h sphere.h syscall.h ui.h motif_mi.h \
	flyby.h flyby_preamble.h

LIB=	$(DEVLIBS) $(XLIBS) $(SLIBS) $(LIBOPTIONS)

EXECUTABLES=display-p3d render-p3d dump-p3d tdump-p3d alisp make_hershey

INSTALLABLES=display-p3d render-p3d dump-p3d tdump-p3d alisp

LOAD_PATH = '"$(ROOT_PATH)/load/"'

DEPEND_FLAGS= $(RENDER_DEFS)

all:: submakes display-p3d render-p3d dump-p3d tdump-p3d alisp hershey.h

hershey.h: make_hershey hfonts.bin
	./make_hershey

make_hershey: make_hershey.c hfonts.h
	$(CC) $(CFLAGS) -o make_hershey make_hershey.c

tdump-p3d: $(ALISP) call_render.o syscall.o $(P3D) tui.o tdump_ren.o \
	indent.o
	$(CC) -o tdump-p3d $(ALISP) call_render.o syscall.o tui.o \
		tdump_ren.o indent.o $(P3D) $(LIB)

dump-p3d: $(ALISP) call_render.o syscall.o $(P3D) tui.o dump_ren.o \
	indent.o
	$(CC) -o dump-p3d $(ALISP) call_render.o syscall.o tui.o \
		dump_ren.o indent.o $(P3D) $(LIB)

display-p3d:  $(ALISP) call_render.o syscall.o $(RENDERER) $(UI) $(P3D)
	$(CC) -o display-p3d $(ALISP) call_render.o syscall.o \
		$(P3D) $(UI) $(RENDERER) $(LIB)

render-p3d:  $(ALISP) call_render.o syscall.o $(RENDERER) tui.o $(P3D)
	$(CC) -o render-p3d $(DORE_DEFS) $(ALISP) call_render.o syscall.o \
		tui.o $(P3D) $(RENDERER) $(LIB)

alisp: $(ALISP) call_out.o syscall.o matrix_ops.o alisp_main.o
	$(CC) -o  alisp $(ALISP) call_out.o syscall.o alisp_main.o -lm

# Triggers for make of files in subdirectories
$(PAINTER): painter-trigger
	$(FILETEST) $@

painter-trigger:
	cd painter ; make

$(RAYSHADE): rayshade-trigger
	$(FILETEST) $@

rayshade-trigger:
	cd rayshade ; make

$(GL_UTILS): sgigl-trigger
	$(FILETEST) $@

sgigl-trigger:
	cd sgigl_utils ; make

# Special make rules - call_render has same dependencies as call_out
call_render.o: call_out.o
	mv call_out.o call_sav.o
	$(CC) $(CFLAGS) -c $(RENDER_DEFS) call_out.c
	mv call_out.o call_render.o
	mv call_sav.o call_out.o

prims.o:
	$(CC) $(CFLAGS) -c -DLOAD_PATH=$(LOAD_PATH) prims.c

makefiles: Imakefile subimakes subdepends
	$(IMAKEDIR)/imake -I$(IMAKEDIR) -DTOPDIR=../. -DTDIR=$(THISDIR)

submakes:
	-for i in dummy $(SUBMAKES) ; do \
	if test $$i != dummy ; then (cd $$i ; make ); else true ; fi ; done

subimakes:
	-for i in dummy $(SUBIMAKES) ; do \
	if test $$i != dummy ; then (\
	  cd $$i ; \
	  ../$(IMAKEDIR)/imake -I../$(IMAKEDIR) \
	    -DTOPDIR=../../. -DTDIR=$(THISDIR)/$$i ; \
	  make subimakes ); \
	else true ; fi ; \
	done

depend:
	@echo " "
	@echo Generating dependencies in $(THISDIR)
	$(IMAKEDIR)/mkdepend -DMAKING_DEPEND -- $(CFLAGS) -- $(CSOURCE)

subdepends:
	-for i in dummy $(SUBIMAKES) ; do \
	if test $$i != dummy ; then (\
		cd $$i ; \
		make subdepends depend ); \
	else true ; fi ; \
	done

clean:
	-rm -f *.o core
	-for i in dummy $(SUBIMAKES) ; do \
	if test $$i != dummy ; then (cd $$i ; make clean ); \
	else true ; fi ; done

clobber: clean
	-rm -f $(EXECUTABLES)
	-for i in dummy $(SUBIMAKES) ; do \
	if test $$i != dummy ; then (cd $$i ; make clobber ); \
	else true ; fi ; done

install:
	-for i in dummy $(INSTALLABLES) ; do \
	if test $$i != dummy ; then \
		(rm $(INSTALL_PATH)/$$i ; mv $$i $(INSTALL_PATH) ); \
	else true ; fi ; done
	-for i in dummy $(LIB_INSTALLABLES) ; do \
	if test $$i != dummy ; then \
		(rm $(LIB_INSTALL_PATH)/$$i ; mv $$i $(LIB_INSTALL_PATH) ); \
	else true ; fi ; done
	-for i in dummy $(SUBIMAKES) ; do \
	if test $$i != dummy ; then (cd $$i ; make install ); \
	else true ; fi ; done

.DEFAULT:
	co $(RCSFLAGS) $@

rcsclean:
	rcsclean $(CSOURCE) $(HFILES) $(FSOURCE) $(OTHER_SOURCE) $(DOCS)
	-for i in dummy $(SUBIMAKES) ; do \
	if test $$i != dummy ; then (cd $$i ; make rcsclean); \
	else true ; fi ; done

rcscheckout: $(CSOURCE) $(HFILES) $(FSOURCE) $(OTHER_SOURCE) $(DOCS)
	-for i in dummy $(SUBIMAKES) ; do \
	if test $$i != dummy ; then (cd $$i ; make rcscheckout); \
	else true ; fi ; done

# Automatically generated dependencies follow
# DO NOT DELETE THIS LINE -- make depend depends on it.

