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

# Uncomment next line to use MultiBuffer extension
MBUFLIB  = -lXext

CDEBUGFLAGS=-O

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

# *************************** End of configuration *************************

.SUFFIXES: .gl

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

REQUIREDLIBS 	= -L.. -lYgl $(MBUFLIB) -lX11

GLTARGETS	= coltest.gl lines.gl rgbtest.gl smile.gl popup.gl
YGLTARGETS	= coltest    lines    rgbtest    smile    popup

all: 	$(YGLTARGETS)
gl: 	$(GLTARGETS)

.c:
	$(CC) $(CFLAGS) -o $@ $< $(REQUIREDLIBS) -lm

.c.gl:
	$(CC) $(CFLAGS) -o $@ $< ../gl2ppm.o -lgl -lm

clean:
	/bin/rm -f *.o *~ $(YGLTARGETS) $(GLTARGETS) *.gif smile_xlf smile_f77 smile_f2c smile_f77.c

smile_f2c: smile_f77.f
	f2c smile_f77.f
	$(CC) $(CFLAGS) -o $@ smile_f77.c -lf2c $(REQUIREDLIBS)

smile_f77: smile_f77.f
	$(FC) $(FFLAGS) -o $@ smile_f77.f $(REQUIREDLIBS)

smile_xlf: smile_xlf.f
	xlf $(FFLAGS) -o $@ smile_xlf.f $(REQUIREDLIBS)
