## Makefile for METAPOSTware (Win32 version)		-*- Makefile -*-
## Time-stamp: "97/08/04 00:11:52 mik"

!include ..\..\miktex.inc

srcdir = .
prefix = $(srcdir)\..\..\..\..
bindir = $(prefix)\miktex\bin

TANGLE = .\..\..\web\tangle
TANGLEFLAGS =
C4P = .\..\..\c4p\c4p
C4PFLAGS =
CFLAGS = -nologo
LD = link
LDFLAGS = -nologo
INSTALL_DATA = copy
INSTALL_PROGRAM = copy

dvitomp_web = dvitomp.web

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

all: makempx.exe dvitomp.exe mptotex.exe

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

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

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

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

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

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

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

dvitomp.p: $(dvitomp_web) dvitomp.win32-changes
	$(TANGLE) $(dvitomp_web) $(srcdir)\dvitomp.win32-changes dvitomp.p nul

install: makempx.exe dvitomp.exe mptotex.exe
	$(INSTALL_PROGRAM) makempx.exe $(bindir)\makempx.exe
	$(INSTALL_PROGRAM) dvitomp.exe $(bindir)\dvitomp.exe
	$(INSTALL_PROGRAM) mptotex.exe $(bindir)\mptotex.exe

uninstall:

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

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

distclean: clean
	-del *.opt

realclean: distclean

depend: makempx.c dvitomp.c mptotex.c
	makedepend -f makefile.win32 -I. -I..\..\lib $**

# DO NOT DELETE

makempx.obj: .\..\..\lib/getopt.h .\..\..\lib/miktex.h .\..\..\lib/c4plib.h
makempx.obj: makempx.rc .\..\..\lib/miktex.version
dvitomp.obj: .\..\..\lib/miktex.h .\..\..\lib/c4plib.h dvitomp.h
