/****************************************************************************
 * Imakefile for drawp3d
 * Author Joel Welling
 * Copyright 1991, Pittsburgh Supercomputing Center, Carnegie Mellon University
 *
 * 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.
 *****************************************************************************/
/* This installer should not have to modify this file */

/* Figure out which renderers to include.  Use Painter if it is the
 * 'standard' renderer for the installation, and use GL if it comes
 * with the platform.
 */
#if (WHICH_RENDERER==PAINTER_REN)
#if (sgi || _IBMR2)
CFLAGS= $(ENV_CFLAGS) $(COPTIONS) -DINCL_PAINTER -DINCL_GL
#else
CFLAGS= $(ENV_CFLAGS) $(COPTIONS) -DINCL_PAINTER
#endif
#else /* WHICH_RENDERER==PAINTER_REN */
#if (sgi || _IBMR2)
CFLAGS= $(ENV_CFLAGS) $(COPTIONS) -DINCL_GL
#else
CFLAGS= $(ENV_CFLAGS) $(COPTIONS)
#endif
#endif /* WHICH_RENDERER==PAINTER_REN */


FLINK= f77

SUBIMAKES= doc

SUBMAKES= doc

SRC= ge_error.c indent.c c_vlist_mthd.c f_vlist_mthd.c m_vlist_mthd.c \
	p3d_ren_mthd.c null_mthd.c camera_mthd.c transform.c attribute.c \
	gob_mthd.c sphere_mthd.c cyl_mthd.c torus_mthd.c text_mthd.c \
	light_mthd.c ambient_mthd.c pmark_mthd.c pline_mthd.c pgon_mthd.c \
	tri_mthd.c bezier_mthd.c mesh_mthd.c cmap_mthd.c chash_mthd.c \
	p3dgen.c std_cmap.c color.c drawp3d_fi.c drawp3d_ci.c boundbox.c \
	isosurf.c cube_cases.c axis.c vector.c zsurface.c material.c \
	dirichlet.c gauss.c rand_zsurf.c rand_isosurf.c symbol.c ihash_mthd.c \
	assist_attr.c default_attr.c assist_prim.c assist_spln.c \
	assist_text.c assist.c dum_ren_mthd.c

PAINT_SRC= pnt_ren_mthd.c painter.c painter_clip.c painter_util.c \
	paintr_trans.c

GL_SRC= gl_ren_mthd.c

OBJ= ge_error.o indent.o c_vlist_mthd.o f_vlist_mthd.o m_vlist_mthd.o \
	p3d_ren_mthd.o null_mthd.o camera_mthd.o transform.o attribute.o \
	gob_mthd.o sphere_mthd.o cyl_mthd.o torus_mthd.o text_mthd.o \
	light_mthd.o ambient_mthd.o pmark_mthd.o pline_mthd.o pgon_mthd.o \
	tri_mthd.o bezier_mthd.o mesh_mthd.o cmap_mthd.o chash_mthd.o \
	p3dgen.o std_cmap.o color.o drawp3d_fi.o drawp3d_ci.o boundbox.o \
	isosurf.o axis.o vector.o zsurface.o material.o \
	dirichlet.o gauss.o rand_zsurf.o rand_isosurf.o symbol.o ihash_mthd.o \
	assist_attr.o default_attr.o assist_prim.o assist_spln.o \
	assist_text.o assist.o dum_ren_mthd.o

PAINT_OBJ= pnt_ren_mthd.o painter.o painter_clip.o painter_util.o \
	paintr_trans.o

GL_OBJ= gl_ren_mthd.o

CSOURCE= $(SRC) $(PAINT_SRC) $(GL_SRC) c_tester.c obj_tester.c dch_tester.c

FSOURCE= f_tester.f drawp3d_def.f

PAINT_HFILES= painter.h paintr_strct.h unix_defs.h unicos_defs.h

GL_HFILES= gl_strct.h

HFILES= FNAMES.h drawp3d.h fnames_.h ge_error.h indent.h p3d_preamble.h \
	p3dgen.h pgen_objects.h std_cmap.h dirichlet.h random_flts.h \
	assist.h cylinder.h sphere.h hershey.h unix_defs.h unicos_defs.h \
	$(PAINT_HFILES) $(GL_HFILES)

OTHER_SOURCE= c_test_std.t f_test_std.t notes.t \
	ob_test_std.t descrip.mms cc.opt dp3d_fi_jbl.jbl

EXECUTABLES= c_tester f_tester obj_tester libdrawp3d.a

LIB_INSTALLABLES= libdrawp3d.a

#if (WHICH_RENDERER==PAINTER_REN)
#if (sgi || _IBMR2)
#ifndef _IBMR2
LIB = $(DRAWCGM) -lgl_s -lc_s -lsphere $(XLIBS) $(LIBOPTIONS)
#else
LIB = $(DRAWCGM) -lgl -lc $(XLIBS) $(LIBOPTIONS)
#endif
ALL_OBJ = $(OBJ) $(PAINT_OBJ) $(GL_OBJ)
#else
LIB = $(DRAWCGM) $(XLIBS) $(LIBOPTIONS)
ALL_OBJ = $(OBJ) $(PAINT_OBJ)
#endif
#else /* WHICH_RENDERER==PAINTER_REN */
#if (sgi || _IBMR2)
#ifndef _IBMR2
LIB = -lgl_s -lc_s -lsphere $(LIBOPTIONS)
#else
LIB = -lgl -lc $(LIBOPTIONS)
#endif
ALL_OBJ = $(OBJ) $(GL_OBJ)
#else
LIB = $(LIBOPTIONS)
ALL_OBJ = $(OBJ)
#endif
#endif /* WHICH_RENDERER==PAINTER_REN */

all:: libdrawp3d.a c_tester obj_tester

libdrawp3d.a: $(ALL_OBJ)
	$(AR) $@ $(ALL_OBJ)
	$(RANLIB) $@

c_tester: c_tester.o $(ALL_OBJ)
	$(CC) -o $@ c_tester.o $(ALL_OBJ) $(LIB)

f_tester: f_tester.o $(ALL_OBJ)
	$(FLINK) -o $@ f_tester.o $(ALL_OBJ) $(LIB) $(FLIBS)

obj_tester: obj_tester.o $(ALL_OBJ)
	$(CC) -o $@ obj_tester.o $(ALL_OBJ) $(LIB)

lint: c_tester.c $(SRC) $(PAINT_SRC) $(GL_SRC)
	lint c_tester.c $(SRC)


