# Makefile for IPAT
# Substitute below for local X library and include locations,
# and compiler options.
#

# comment this out if not using gcc (default is "cc")
CC = gcc

# setup for SunOS (X is in /usr/openwin)
#LINKS = -lm -L/usr/openwin/lib -lX11
#INCX = /usr/openwin/include

# setup for generic UNIX
LINKS = -lm -L/usr/X11R6/lib -lX11
INCX = /usr/X11R6/include

CFLAGS = -O -I. -Ixmfb

ipat: ipat.o fb.o ginterf.o mfb.a
	$(CC) -O -o ipat ipat.o fb.o ginterf.o mfb.a $(LINKS)

.c.o: $*.c
	$(CC) $(CFLAGS) -I$(INCX) -c $*.c

mfb.a::
	cd xmfb; make CC=$(CC) INCX=$(INCX)

clean::
	-rm *.a *.o ipat
	-rm xmfb/*.o

ipat.o: xmfb/mfb.h fb.h driver.h
fb.o: fb.h driver.h
ginterf.o: driver.h
