# Generated automatically from Makefile.in by configure.
#
# Makefile.in for GIST CGM browser
#
# $Id$
#

# This flag should be set to whatever your compiler needs to tell it
# to optimize (-O usually) or debug (-g usually).
# C_OPTIMIZE = -g
C_OPTIMIZE = -O

SHELL = /bin/sh

srcdir = .
VPATH = .

prefix = /usr/local
exec_prefix = $(prefix)

Y_BINDIR = $(exec_prefix)/bin

CC = shlicc
RM = rm -f
CP = cp

DEFS =  
CFLAGS = $(C_OPTIMIZE) $(DEFS) -I$(srcdir)

# Change these to compile gist using installed headers and libraries
GISTL = ../Gist
GISTI = ../Gist

LD_OPTIMIZE = $(C_OPTIMIZE)
LDOPTS = 
LDFLAGS = $(LD_OPTIMIZE) $(LDOPTS)

# The lowest level (last) libraries required on the load line go here.
# LOWLIBS = -lm -lc            (if Y_LD is not your C compiler)
LOWLIBS = -lm 

# Usage:   $(Y_LD) $(OBJS) $(LIBS)
Y_LD = $(CC) $(LDFLAGS) -o $@

# See D_NO_XLIB below for how to omit X engines entirely
XINCLUDE = -I/usr/X11R6/include
XLOAD = -L/usr/X11R6/lib -lX11

# If sizeof(short)==2 and the most significant byte of a short is the
# first byte (i.e- the machine is a big-endian), use the nil version
# of D_NOT_CGM_ORDER, else the non-nil version.  Crays and DECs need
# the non-nil version.  Suns, HPs, and most others, the nil version.
# D_NOT_CGM_ORDER = -DNOT_CGM_ORDER
# D_NOT_CGM_ORDER =
D_NOT_CGM_ORDER = -DNOT_CGM_ORDER

# Use the non-nil version to make a gist which doesn't reference Xlib
# D_NO_XLIB = -DNO_XLIB
# D_NO_XLIB =
D_NO_XLIB = 

OBJS = main.o cgmin.o eps.o


all:: gist

gist: $(OBJS)
	$(Y_LD) $(OBJS) -L$(GISTL) -lgist $(XLOAD) $(LOWLIBS)

install: all installdirs
	$(CP) gist $(Y_BINDIR)

uninstall:
	$(RM) -r $(Y_BINDIR)/gist

installdirs:
	if test ! -d $(Y_BINDIR); then mkdir $(Y_BINDIR); fi

# TAGS table for Emacs
tags:
	etags -tw *.h *.c

# index for vgrind (a pretty C printing routine)
index:
	etags -twv *.h *.c >index

clean: tidy
	$(RM) *.a gist

tidy:
	$(RM) *.o *~ *.cgm core

distclean: clean
	$(RM) Makefile



G_CFLAGS = $(CFLAGS) -I$(GISTI)

# Remove TARGET_ARCH nonsense on Suns
.c.o:
	$(CC) $(CPPFLAGS) $(G_CFLAGS) -c $<



# header dependencies, also special compiles

main.o: cgmin.h eps.h main.c
	$(CC) $(CPPFLAGS) $(G_CFLAGS) $(XINCLUDE) $(D_NO_XLIB) -c main.c
cgmin.o: cgmin.h cgmin.c
	$(CC) $(CPPFLAGS) $(G_CFLAGS) $(D_NOT_CGM_ORDER) -c cgmin.c
eps.o: eps.h
