# ----------------------------------------------------------------------------
# Makefile for PSint versions.
#             F.Lelaquais (lelaquaf@apo.esiee.fr)
#
#  This should work for many kind of sites, as
# I hate the device-dependant hints.
#
# ----------------------------------------------------------------------------
#  For Apollo, 4 versions can be made :
#
#  int      : A full PostScript interpretor which has no graphic capabilities
#  PSint    : The same, with full graphic DM support
#  PSborrow : The same, with graphics in Borrow mode, allowing wider pages,
#             in which you can move...
#             You will need my MM library...
#  PSx      : A X version, running on any X station (not finished)
# ----------------------------------------------------------------------------

OBJECTS=error.o fonc.o cache.o exec.o font.o path.o\
 com.o file.o gstate.o dict.o fill.o fillalgorithm.o \
 image.o objects.o parse.o memory.o version.o stroke.o

# you can add -DMEMDEBUG=0 or 1 if you wish to memory-debug PSint
CFLAGS=-O

# If you have my MMLIB (menus and windows manager under D.M.) :
MMLIB=/user/lelaquaf/sys/lib/mmlib

ints: ../int ../PSint

all: ints ../PSx ../PSborrow

../int: main.o $(OBJECTS) rest.o  inout.o
	ld -o ../int      main.o $(OBJECTS) rest.o   inout.o  -lm
../PSint: main.o $(OBJECTS) apollo.o  inout.o
	ld -o ../PSint    main.o $(OBJECTS) apollo.o inout.o  -lm
../PSx: main.o $(OBJECTS) X.o inout.o
	ld -o ../PSx      main.o $(OBJECTS) X.o      inout.o  -lm -L/usr/lib/X11/ -lX11
../PSborrow: main.o $(OBJECTS) borrow.o
	ld -o ../PSborrow main.o $(OBJECTS) borrow.o $(MMLIB)

tags: TAGSint
TAGSint: main.c error.c fonc.c cache.c exec.c font.c path.c com.c file.c gstate.c dict.c fill.c fillalgorithm.c image.c objects.c parse.c memory.c version.c inout.c rest.c stroke.c
	etags  -f TAGSint main.c error.c fonc.c cache.c exec.c font.c path.c com.c file.c gstate.c dict.c fill.c fillalgorithm.c image.c objects.c parse.c memory.c version.c inout.c rest.c stroke.c

main.o:    int.h
error.o:   int.h
fonc.o:    int.h
exec.o:    int.h
com.o:     int.h
file.o:    int.h
dict.o:    int.h
objects.o: int.h
memory.o:  int.h
cache.o:   int.h graph.h
font.o:    int.h graph.h
path.o:    int.h graph.h
parse.o:   int.h
gstate.o:  int.h graph.h
fill.o:          int.h graph.h fill.h
fillalgorithm.o: int.h graph.h fill.h
image.o:         int.h graph.h

int.h: machine.h

## Device-dependant interfaces
rest.o:   int.h graph.h
apollo.o: int.h graph.h
borrow.o: int.h graph.h
X.o:      int.h graph.h 
# I needed that with X11 on Apollo rev 10.1
#	cc $(CFLAGS) -U__STDC__ -D_PROTOTYPES -c X.c


