## Makefile for dvips (Win32 version)			-*- Makefile -*-
## Time-stamp: "97/08/14 23:30:11 mik"

!include ..\..\miktex.inc

srcdir = .
dvidocdir = $(prefix)\doc\dvips
dvibasedir = $(prefix)\dvips\base
dvipsconfigdir = $(prefix)\dvips\config\local
dvipsmacrodir = $(prefix)\tex\generic\dvips

DEFS = -DTPIC -DDEBUG -DDEFRES=600 -DCREATIONDATE -DHAVE_GETCWD -DANSI \
		-DHPS -DMIKTEX -DMIKTEX_DLL -DEMTEX

PATHS = -DTFMPATH=\".\" \
	-DPKPATH=\".\" \
	-DVFPATH=\".\" \
	-DHEADERPATH=\".\" \
	-DCONFIGPATH=\".\" \
        -DCONFIGFILE=\"config.ps\" \
	-DFONTSUBDIRPATH=\".\" \
	-DFIGPATH=\".\"

SRC = dospecial.c dviinput.c fontdef.c loadfont.c dvips.c tfmload.c \
	download.c prescan.c scanpage.c skippage.c output.c scalewidth.c \
	dosection.c dopage.c resident.c search.c unpack.c drawPS.c \
	header.c makefont.c repack.c virtualfont.c dpicheck.c finclude.c \
	pprescan.c papersiz.c flib.c color.c bbox.c emspecial.c t1part.c \
        hps.c

OBJ = dospecial.obj dviinput.obj fontdef.obj loadfont.obj dvips.obj \
	tfmload.obj download.obj prescan.obj scanpage.obj skippage.obj \
	output.obj scalewidth.obj dosection.obj dopage.obj resident.obj \
	search.obj unpack.obj drawPS.obj header.obj makefont.obj repack.obj \
	virtualfont.obj dpicheck.obj finclude.obj pprescan.obj papersiz.obj \
	flib.obj color.obj bbox.obj emspecial.obj t1part.obj hps.obj

.c.obj:
	$(CC) -c -I$(libdir) $(DEFS) $(PATHS) $(OPT) $(SYS) $(EMTEX) \
		$(DEFPFMT) $(cflags) $(release_info) -MD -O2 $<

all : afm2tfm.exe dvips.exe tex.pro texps.pro texc.pro special.pro \
	finclude.pro color.pro crop.pro hps.pro

dvips.exe : $(OBJ) $(libdir)\miktex.lib dvips.res
	link $(ldflags) $(LDFLAGS) -out:$@ $** advapi32.lib

dvips.res: dvips.rc $(libdir)\miktex.version $(libdir)\version.h
	rc -I$(libdir) dvips.rc

afm2tfm.exe: afm2tfm.obj afm2tfm.res
	link $(ldflags) -out:$@ $**

afm2tfm.res: afm2tfm.rc $(libdir)\miktex.version $(libdir)\version.h
	rc -I$(libdir) afm2tfm.rc

squeeze.exe : squeeze.obj
	link $(ldflags) -out:$@ $**

tex.pro : tex.lpro squeeze.exe
	.\squeeze <tex.lpro >tex.pro

texc.pro: texc.lpro squeeze.exe
	.\squeeze <texc.lpro >texc.pro

texc.lpro: makefile.win32 tex.lpro
	sed -e "/% begin code for uncompressed fonts only/,/% end code for uncompressed fonts only/d" \
		-e "/% % here's the alternate code for unpacking compressed fonts/,/% % end of code for unpacking compressed fonts/ s/% / /" tex.lpro > texc.lpro

texps.pro : texps.lpro squeeze.exe
	.\squeeze <texps.lpro >texps.pro

special.pro : special.lpro squeeze.exe
	.\squeeze <special.lpro >special.pro

finclude.pro : finclude.lpro squeeze.exe
	.\squeeze <finclude.lpro >finclude.pro

color.pro : color.lpro squeeze.exe
	.\squeeze <color.lpro >color.pro

crop.pro : crop.lpro squeeze.exe
	.\squeeze <crop.lpro >crop.pro

hps.pro : hps.lpro squeeze.exe
	.\squeeze <hps.lpro >hps.pro

dvips.dvi: dvips.tex
	tex dvips

dvips.1.dvi: dvips.1
   eqn dvips.1 | tbl | troff -Tdvi -man | grodvi >$@
#groff -Tdvi -man dvips.1 >$@

afm2tfm.1.dvi: afm2tfm.1
   eqn afm2tfm.1 | tbl | troff -Tdvi -man | grodvi >$@
#groff -Tdvi -man afm2tfm.1 >$@

install : afm2tfm.exe dvips.exe \
	tex.pro texc.pro texps.pro special.pro finclude.pro color.pro \
	crop.pro hps.pro psfonts.map epsf.tex epsf.sty rotate.tex \
	rotate.sty colordvi.tex colordvi.sty blackdvi.tex blackdvi.sty \
	dvips.dvi afm2tfm.1.dvi dvips.1.dvi \
	config.miktex.ps
	$(INSTALL_PROGRAM) afm2tfm.exe $(bindir)\afm2tfm.exe
	$(INSTALL_PROGRAM) dvips.exe $(bindir)\dvips.exe
	$(INSTALL_DATA) tex.pro $(dvibasedir)\tex.pro
	$(INSTALL_DATA) texc.pro $(dvibasedir)\texc.pro
	$(INSTALL_DATA) texps.pro $(dvibasedir)\texps.pro
	$(INSTALL_DATA) special.pro $(dvibasedir)\special.pro
	$(INSTALL_DATA) finclude.pro $(dvibasedir)\finclude.pro
	$(INSTALL_DATA) color.pro $(dvibasedir)\color.pro
	$(INSTALL_DATA) crop.pro $(dvibasedir)\crop.pro
	$(INSTALL_DATA) hps.pro $(dvibasedir)\hps.pro
	$(INSTALL_DATA) config.miktex.ps $(dvipsconfigdir)\config.ps
	$(INSTALL_DATA) psfonts.map $(dvipsbasedir)\psfonts.map
	$(INSTALL_DATA) epsf.tex $(dvipsmacrodir)\epsf.tex
	$(INSTALL_DATA) epsf.sty $(dvipsmacrodir)\epsf.sty
	$(INSTALL_DATA) rotate.tex $(dvipsmacrodir)\rotate.tex
	$(INSTALL_DATA) rotate.sty $(dvipsmacrodir)\rotate.sty
	$(INSTALL_DATA) colordvi.sty $(dvipsmacrodir)\colordvi.sty
	$(INSTALL_DATA) colordvi.tex $(dvipsmacrodir)\colordvi.tex
	$(INSTALL_DATA) blackdvi.sty $(dvipsmacrodir)\blackdvi.sty
	$(INSTALL_DATA) blackdvi.tex $(dvipsmacrodir)\blackdvi.tex
	$(INSTALL_DATA) dvipsmac.tex $(dvipsmacrodir)\dvipsmac.tex
	$(INSTALL_DATA) dvips.dvi $(dvidocdir)\dvips.dvi
	$(INSTALL_DATA) afm2tfm.1.dvi $(dvidocdir)\afm2tfm.1.dvi
	$(INSTALL_DATA) dvips.1.dvi $(dvidocdir)\dvips.1.dvi

mostlyclean:
	-del *.log
	-del *.obj
	-del *.res
	-del squeeze.exe
	-del afm2tfm.exe
	-del makefile.win32.bak

clean: mostlyclean
	-del *.dvi
	-del *.ilk
	-del *.pdb
	-del dvips.exe
	-del texc.lpro
	-del *.pro

distclean: clean
	-del *.opt

depend: $(SRC)
	makedepend -f makefile.win32 -DMIKTEX -I. -I..\..\lib $**

# DO NOT DELETE

dospecial.obj: dvips.h paths.h debug.h
dviinput.obj: dvips.h paths.h debug.h
fontdef.obj: dvips.h paths.h debug.h
loadfont.obj: dvips.h paths.h debug.h
dvips.obj: ..\..\lib/miktex.version ..\..\lib/version.h dvips.h paths.h
dvips.obj: debug.h
tfmload.obj: dvips.h paths.h debug.h
download.obj: dvips.h paths.h debug.h t1part.h
prescan.obj: dvips.h paths.h debug.h
scanpage.obj: dvips.h paths.h debug.h
skippage.obj: dvips.h paths.h debug.h
output.obj: dvips.h paths.h debug.h
scalewidth.obj: dvips.h paths.h debug.h
dosection.obj: dvips.h paths.h debug.h
dopage.obj: dvips.h paths.h debug.h
resident.obj: ..\..\lib/miktex.h dvips.h paths.h debug.h
search.obj: dvips.h paths.h debug.h ..\..\lib/miktex.h
unpack.obj: dvips.h paths.h debug.h
header.obj: dvips.h paths.h debug.h
makefont.obj: dvips.h paths.h debug.h ..\..\lib/miktex.h
repack.obj: dvips.h paths.h debug.h
virtualfont.obj: dvips.h paths.h debug.h
dpicheck.obj: dvips.h paths.h debug.h
finclude.obj: dvips.h paths.h debug.h
pprescan.obj: dvips.h paths.h debug.h
papersiz.obj: dvips.h paths.h debug.h
color.obj: dvips.h paths.h debug.h
bbox.obj: dvips.h paths.h debug.h
emspecial.obj: dvips.h paths.h debug.h
t1part.obj: dvips.h paths.h debug.h t1part.h
