# Copyright information can be found in file "Copyright".

# File extensions used:
# psr: prologue source files.
# pro: installed prologue files.

# List of all PostScript prologue files.
#  (1) texpre.psr: standard TeX code. Downloaded for each job.
#  (2) pos.psr: some positioning code. Also downloaded each job.
#  (3) rules.psr: rule business. Also downloaded each job.
#  (4) pixel-fonts.psr: everything which has to do with pixel based fonts.
#  (5) ps-fonts.psr: initial first code for PS fonts
#  (6) reencode.psr: code to set the encoding vector for PS fonts.
#  (7) set-widths.psr: set the widths for the PS fonts.
#  (8) ellipse.psr: tpic stuff.
#  (9) spline.psr: also tpic stuff.
# (10) gray.psr: paint a gray line, for "gray highlighting".
PRO_SOURCES = texpre.psr pos.psr rules.psr pixel-fonts.psr ps-fonts.psr\
	      reencode.psr set-widths.psr spline.psr ellipse.psr gray.psr\
	      psfig.psr mac.psr

SRC = install-ps.c
OBJ = install-ps.o

# Directory where the .pro files are also installed (besides the
# place of the 'official' installation.
DIR_PRO = ../pro

DEFS = -DTMPDIR=\"$(TMPDIR)\" -DSYS_V=$(SYS_V)
INCS = -I. -I../../h
GFLAG =
CFLAGS = $(GFLAG) $(DEFS) $(INCS)
LDFLAGS = $(GFLAG)

# See install-ps.c for further information. These flags control in which
# ways the .pro files are modified before they are installed.
INSTALL_FLAGS = -CW

LIB_DIR = ../../lib
SUP = ../../sup

all:	install-ps $(DIR_PRO)
	
relink:
	$(RM) install-ps
	make  all

$(DIR_PRO):	$(PRO_SOURCES) install-ps
	-yes | $(RM) -r $(DIR_PRO)
	mkdir           $(DIR_PRO)
	./install-ps         $(INSTALL_FLAGS) $(DIR_PRO) $(PRO_SOURCES)

# Install all those files in the reserved directory. The DEBUG
# flag will be handled here!
install:	install-ps
	-mkdir	     $(DRIVER_PS_PROLOGUE_FILES_DIR)
# See source of driver for details for what these files are good for.
	./install-ps $(INSTALL_FLAGS) $(DRIVER_PS_PROLOGUE_FILES_DIR) $(PRO_SOURCES)

# Make the installation program and also run it so that a copy
# of the .pro files resides in this directory!
install-ps: $(OBJ)
	cd $(LIB_DIR); make
	$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIB_DIR)/libics.a

depend:	$(SRC)
	maketd -mIMakefile $(DEFS) $(INCS) $(SRC)

lint:

print:	Makefile $(SRC) $(PRO_SOURCES)
	$(PRINT_COMMAND) Makefile $(SRC) $(PRO_SOURCES)


clean::
	$(RM) install-ps *.pro
	-yes | $(RM) -r $(DIR_PRO)

# DO NOT DELETE THIS LINE - make depend DEPENDS ON IT
A=../../h

install-ps.o: $A/extfil.h install-ps.c

# *** Do not add anything here - It will go away. ***
