## makefile.win32 (TeXware)				-*- Makefile -*-
## Time-stamp: "97/08/04 00:13:32 mik"

!include ..\miktex.inc

srcdir = .

pooltype_web = $(srcdir)\pooltype.web
dvitype_web = $(srcdir)\dvitype.web
pltotf_web = $(srcdir)\pltotf.web
tftopl_web = $(srcdir)\tftopl.web

.c.obj:
	$(CC) -c -I$(srcdir) -I$(libdir) -DMIKTEX_DLL $(release_info) \
		-MD -O2 $(cflags) $(CFLAGS) $<

all: pooltype.exe dvitype.exe pltotf.exe tftopl.exe

pooltype.exe: pooltype.obj $(libdir)\miktex.lib pooltype.res
	link $(ldflags) $(LDFLAGS) -out:$@ $**

pooltype.res: pooltype.rc $(libdir)\miktex.version $(libdir)\version.h
	rc -I$(srcdir)\..\lib pooltype.rc

dvitype.exe: dvitype.obj $(libdir)\miktex.lib dvitype.res
	link $(ldflags) $(LDFLAGS) -out:$@ $**

dvitype.res: dvitype.rc $(libdir)\miktex.version $(libdir)\version.h
	rc -I$(srcdir)\..\lib dvitype.rc

pltotf.exe: pltotf.obj $(libdir)\miktex.lib pltotf.res
	link $(ldflags) $(LDFLAGS) -out:$@ $**

pltotf.res: pltotf.rc $(libdir)\miktex.version $(libdir)\version.h
	rc -I$(srcdir)\..\lib pltotf.rc

tftopl.exe: tftopl.obj $(libdir)\miktex.lib tftopl.res
	link $(ldflags) $(LDFLAGS) -out:$@ $**

tftopl.res: tftopl.rc $(libdir)\miktex.version $(libdir)\version.h
	rc -I$(srcdir)\..\lib tftopl.rc

pooltype.c pooltype.h: pooltype.p
	$(C4P) $(C4PFLAGS) --rename link --rename index \
		--include-filename=miktex.h --one=pooltype pooltype.p

pooltype.p: $(pooltype_web) pooltype.win32-changes
	$(TANGLE) $(pooltype_web) $(srcdir)\pooltype.win32-changes \
				pooltype.p nul

dvitype.c dvitype.h: dvitype.p
	$(C4P) $(C4PFLAGS) --rename link --rename index \
		--include-filename=miktex.h --one=dvitype dvitype.p

dvitype.p: $(dvitype_web) dvitype.win32-changes
	$(TANGLE) $(dvitype_web) $(srcdir)\dvitype.win32-changes dvitype.p nul

pltotf.c pltotf.h: pltotf.p
	$(C4P) $(C4PFLAGS) --rename link --rename index \
		--include-filename=miktex.h --one=pltotf pltotf.p

pltotf.p: $(pltotf_web) pltotf.win32-changes
	$(TANGLE) $(pltotf_web) $(srcdir)\pltotf.win32-changes pltotf.p nul

tftopl.c tftopl.h: tftopl.p
	$(C4P) $(C4PFLAGS) --rename link --rename index \
		--include-filename=miktex.h --one=tftopl tftopl.p

tftopl.p: $(tftopl_web) tftopl.win32-changes
	$(TANGLE) $(tftopl_web) $(srcdir)\tftopl.win32-changes tftopl.p nul

install: pooltype.exe dvitype.exe pltotf.exe tftopl.exe
	$(INSTALL_PROGRAM) pooltype.exe $(bindir)\pooltype.exe
	$(INSTALL_PROGRAM) dvitype.exe $(bindir)\dvitype.exe
	$(INSTALL_PROGRAM) pltotf.exe $(bindir)\pltotf.exe
	$(INSTALL_PROGRAM) tftopl.exe $(bindir)\tftopl.exe

uninstall:

mostlyclean:
	-del *.obj
	-del *.c
	-del *.h
	-del *.p
	-del *.res
	-del makefile.win32.bak

clean: mostlyclean
	-del *.exe
	-del *.ilk
	-del *.pdb

distclean: clean
	-del *.opt

realclean: distclean

depend: dvitype.c pooltype.c tftopl.c pltotf.c
	makedepend -f makefile.win32 -I. -I..\lib $**

# DO NOT DELETE

dvitype.obj: ..\lib/miktex.h ..\lib/c4plib.h dvitype.h
pooltype.obj: ..\lib/miktex.h ..\lib/c4plib.h pooltype.h
tftopl.obj: ..\lib/miktex.h ..\lib/c4plib.h tftopl.h
pltotf.obj: ..\lib/miktex.h ..\lib/c4plib.h pltotf.h
