#
# @(#)Makefile.customer 1.6 96/01/23 SMI
#
# Copyright (c) 1995 by Sun Microsystems, Inc.
# All Rights Reserved


              TOP = .

               AR = ar cq
               CC = cc
               RM = rm -f
           RM_CMD = $(RM) *.o core ,* *.a 
       OGLHOME:sh = echo ${OGLHOME:-/usr/openwin}

      STD_DEFINES = -DSVR4 -DSYSV
 EXTRA_LOAD_FLAGS =
  EXTRA_LDOPTIONS = -R/usr/openwin/lib:$(OGLHOME)/lib
  EXTRA_LIBRARIES = -lsocket -lnsl

      CDEBUGFLAGS = -O 

       ALLDEFINES = $(INCLUDES)
           CFLAGS = $(CDEBUGFLAGS) $(ALLDEFINES)
	  CCFLAGS = $(CDEBUGFLAGS) $(ALLDEFINES)

           LDLIBS = $(EXTRA_LIBRARIES)

        LDOPTIONS = $(CDEBUGFLAGS) $(EXTRA_LDOPTIONS) $(USRLIBDIR)


# -------------------------------------------------------------------------
# X Window System make variables; this need to be coordinated with rules

        USRLIBDIR = -L$(OGLHOME)/lib -L$(OPENWINHOME)/lib
          INCROOT = $(OPENWINHOME)/include
           INCDIR = -I$(INCROOT)/X11 -I$(OGLHOME)/include

         PICFLAGS = -K PIC
             XLIB = -lXext -lX11



# -------------------------------------------------------------------------

SRCS = \
accanti.c        clip.c           list.c           scenebamb.c \
accnot.c         colormat.c       list2.c          sceneflat.c \
accpersp.c       cone.c           maplight.c       select.c \
accum.c          cube.c           material.c       simple.c \
aim.c            curve.c          mipmap.c         smooth.c \
alpha.c          depthcue.c       model.c          sphere.c \
alpha3D.c        disk.c           movelight.c      stencil.c \
anti.c           dof.c            nurbs.c          stroke.c \
antiindex.c      dofnot.c         pickdepth.c      surface.c \
antipindex.c     double.c         pickline.c       tea.c \
antipoint.c      drawf.c          picksquare.c     teaambient.c \
antipoly.c       feedback.c       plane.c          teapots.c \
bezcurve.c       fog.c            planet.c         texgen.c \
bezmesh.c        fogindex.c       planetup.c       texturesurf.c \
bezsurf.c        font.c           polys.c          trim.c \
checker.c        light.c          robot.c          xfont.c \
checker2.c       linelist.c       sccolorlight.c \
chess.c          lines.c          scene.c

PROGRAMS = \
accanti        clip           list           scenebamb \
accnot         colormat       list2          sceneflat \
accpersp       cone           maplight       select \
accum          cube           material       simple \
aim            curve          mipmap         smooth \
alpha          depthcue       model          sphere \
alpha3D        disk           movelight      stencil \
anti           dof            nurbs          stroke \
antiindex      dofnot         pickdepth      surface \
antipindex     double         pickline       tea \
antipoint      drawf          picksquare     teaambient \
antipoly       feedback       plane          teapots \
bezcurve       fog            planet         texgen \
bezmesh        fogindex       planetup       texturesurf \
bezsurf        font           polys          trim \
checker        light          robot          xfont \
checker2       linelist       sccolorlight \
chess          lines          scene

DEP_LIBRARIES = ../libaux/libaux.a

LOCAL_LIBRARIES = $(DEP_LIBRARIES) $(XLIB) -lGL -lGLU

INCLUDES = -I. -I../libaux -I$(OGLHOME)/include -I/usr/openwin/include

all:: $(PROGRAMS)

$(DEP_LIBRARIES):
	cd ../libaux; make

accanti: accanti.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ accanti.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) accanti

accnot: accnot.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ accnot.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) accnot

accpersp: accpersp.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ accpersp.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) accpersp

accum: accum.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ accum.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) accum

aim: aim.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ aim.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) aim

alpha: alpha.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ alpha.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) alpha

alpha3D: alpha3D.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ alpha3D.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) alpha3D

anti: anti.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ anti.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) anti

antiindex: antiindex.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ antiindex.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) antiindex

antipindex: antipindex.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ antipindex.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) antipindex

antipoint: antipoint.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ antipoint.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) antipoint

antipoly: antipoly.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ antipoly.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) antipoly

bezcurve: bezcurve.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ bezcurve.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) bezcurve

bezmesh: bezmesh.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ bezmesh.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) bezmesh

bezsurf: bezsurf.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ bezsurf.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) bezsurf

checker: checker.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ checker.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) checker

checker2: checker2.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ checker2.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) checker2

chess: chess.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ chess.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) chess

clip: clip.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ clip.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) clip

colormat: colormat.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ colormat.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) colormat

cone: cone.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ cone.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) cone

cube: cube.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ cube.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) cube

curve: curve.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ curve.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) curve

depthcue: depthcue.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ depthcue.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) depthcue

disk: disk.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ disk.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) disk

dof: dof.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ dof.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) dof

dofnot: dofnot.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ dofnot.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) dofnot

double: double.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ double.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) double

drawf: drawf.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ drawf.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) drawf

feedback: feedback.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ feedback.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) feedback

fog: fog.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ fog.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) fog

fogindex: fogindex.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ fogindex.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) fogindex

font: font.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ font.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) font

light: light.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ light.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) light

linelist: linelist.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ linelist.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) linelist

lines: lines.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ lines.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) lines

list: list.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ list.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) list

list2: list2.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ list2.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) list2

maplight: maplight.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ maplight.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) maplight

material: material.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ material.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) material

mipmap: mipmap.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ mipmap.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) mipmap

model: model.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ model.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) model

movelight: movelight.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ movelight.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) movelight

nurbs: nurbs.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ nurbs.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) nurbs

pickdepth: pickdepth.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ pickdepth.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) pickdepth

pickline: pickline.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ pickline.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) pickline

picksquare: picksquare.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ picksquare.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) picksquare

plane: plane.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ plane.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) plane

planet: planet.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ planet.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) planet

planetup: planetup.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ planetup.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) planetup

polys: polys.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ polys.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) polys

robot: robot.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ robot.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) robot

sccolorlight: sccolorlight.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ sccolorlight.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) sccolorlight

scene: scene.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ scene.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) scene

scenebamb: scenebamb.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ scenebamb.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) scenebamb

sceneflat: sceneflat.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ sceneflat.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) sceneflat

select: select.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ select.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) select

simple: simple.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ simple.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) simple

smooth: smooth.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ smooth.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) smooth

sphere: sphere.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ sphere.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) sphere

stencil: stencil.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ stencil.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) stencil

stroke: stroke.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ stroke.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) stroke

surface: surface.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ surface.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) surface

tea: tea.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ tea.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) tea

teaambient: teaambient.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ teaambient.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) teaambient

teapots: teapots.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ teapots.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) teapots

texgen: texgen.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ texgen.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) texgen

texturesurf: texturesurf.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ texturesurf.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) texturesurf

trim: trim.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ trim.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) trim

xfont: xfont.o $(DEP_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ xfont.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) -lm $(EXTRA_LOAD_FLAGS)

clean::
	$(RM) xfont

clean::
	$(RM_CMD)
