TARGET = texttorle

PSW = /usr/sbin/pswrap

OBJS = texttorle.o PSutils.o stringutils.o

# If you want to run a debugger on these programs, remove the option -s from 
# LDFLAGS, and add -g to the LCOPTS line.
# The option -cckr is needed to avoid warning messages, because the include
# file /usr/include/X11/extensions/dpsfriends.h does not comply with ANSI C.
LCOPTS = -g -cckr -c -I.
# The options -Wf,-XNf15000 -Wf,-XNd15000 -Wf,-XNp15000 are not needed for 
# the simple sample PS code stored in the file pswdpsglx.psw, but they are 
# needed for more complex PS code that can be put into that file.
LCOPTS1 = -cckr -Wf,-XNf15000 -Wf,-XNd15000 -Wf,-XNp15000 -c -I/usr/include/DPS
LDFLAGS = -lgl_s -ldps -lXext -lX11_s -lm 

all: $(TARGET)

texttorle: $(OBJS)
	$(CC) -o $@ $(OBJS) $(LDFLAGS)

stringutils.o: stringutils.psw
	$(PSW) -o stringutils.c stringutils.psw
	$(CC) $(LCOPTS1) -I/usr/include/DPS stringutils.c

texttorle.o: texttorle.c
	$(CC) $(LCOPTS) texttorle.c

PSutils.o: PSutils.c
	$(CC) $(LCOPTS) -I/usr/include/DPS PSutils.c

clean:
	rm -f *.o texttorle stringutils.c
