#
#    Ygl: Run 2d-GL programs with standard X11 routines.
#    (C) Fred Hucht 1993-95
#    EMail: fred@thp.Uni-Duisburg.DE
#

# Uncomment next two lines to include FORTRAN bindings
FBO		= fortran.o
FBH		= X11/Yfgl.h

OBJS		= ygl.o misc.o draw.o queue.o color.o font.o gl2ppm.o $(FBO) 
TARGET          = libYgl.a

# Uncomment next line to use MultiBuffer extension
MULTIBUF 	= -DMULTIBUF

# Uncomment next two lines to prepend "ygl_" to all function names 
#YGL_PREFIX	= -DYGL_PREFIX
#PH		= X11/Yglprefix.h
#TARGET		= libYglp.a

CDEBUGFLAGS	= -O

COPTS = $(MULTIBUF)
# COPTS = -Aa -D_HPUX_SOURCE -DMULTIBUFLIB -L/usr/lib/X11R4 -I/usr/include/X11R4 # For HP-UX 8.0x
# COPTS = -Ae $(MULTIBUF) -L/usr/lib/X11R5 -I/usr/include/X11R5 # For HP-UX 9.0x

# End of configuration

CFLAGS		= -I. $(CDEBUGFLAGS) $(COPTS) $(YGL_PREFIX)

all: 	$(TARGET)

.c.o:	
	$(CC) -c $(CFLAGS) $<

X11/Yglprefix.h:	X11/Ygl.h mkprefix
	mkprefix

header.h:	config.h X11/Ygl.h X11/Yglprefix.h

$(OBJS):	header.h

$(TARGET):	$(OBJS)
	/bin/rm -f $@
	ar rv $@ $(OBJS)
	ranlib $@

install:	$(TARGET)
	cp $(TARGET) /usr/lib/$(TARGET) 
	ranlib /usr/lib/$(TARGET)
	cp X11/Ygl.h $(FBH) $(PH) /usr/include/X11

clean:
	/bin/rm -f *.o *~ $(TARGET) X11/Yglprefix.h

etags:
	etags *.[ch]
