## Makefile for MFware (Win32 version)		-*- Makefile -*-
## Time-stamp: "97/08/04 00:12:25 mik"

!include ..\miktex.inc

srcdir = .
gftodvi_web = $(srcdir)\gftodvi.web
gftopk_web = $(srcdir)\gftopk.web
gftype_web = $(srcdir)\gftype.web
mft_web = $(srcdir)\mft.web

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

all: gftopk.exe gftype.exe gftodvi.exe mft.exe

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

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

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

gftopk.p: $(gftopk_web) gftopk.win32-changes
	$(TANGLE) $(gftopk_web) $(srcdir)\gftopk.win32-changes gftopk.p nul

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

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

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

gftype.p: $(gftype_web) gftype.win32-changes
	$(TANGLE) $(gftype_web) $(srcdir)\gftype.win32-changes gftype.p nul

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

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

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

gftodvi.p: $(gftodvi_web) gftodvi.win32-changes
	$(TANGLE) $(gftodvi_web) $(srcdir)\gftodvi.win32-changes gftodvi.p nul

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

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

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

mft.p: $(mft_web) mft.win32-changes
	$(TANGLE) $(mft_web) $(srcdir)\mft.win32-changes mft.p nul

install: gftopk.exe gftype.exe gftodvi.exe mft.exe
	$(INSTALL_PROGRAM) gftopk.exe $(bindir)\gftopk.exe
	$(INSTALL_PROGRAM) gftype.exe $(bindir)\gftype.exe
	$(INSTALL_PROGRAM) gftodvi.exe $(bindir)\gftodvi.exe
	$(INSTALL_PROGRAM) mft.exe $(bindir)\mft.exe

uninstall:

mostlyclean:
	-del *.obj
	-del *.c
	-del *.h
	-del *.p
	-del *.res

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

distclean: clean
	-del *.opt
	-del makefile.win32.bak

realclean: distclean

depend: gftopk.c gftype.c gftodvi.c mft.c
	makedepend -f makefile.win32 -I. -I..\lib $**

# DO NOT DELETE

gftopk.obj: ..\lib\c4plib.h gftopk.h
gftype.obj: ..\lib\c4plib.h gftype.h
gftodvi.obj: ..\lib\miktex.h ..\lib\c4plib.h gftodvi.h
mft.obj: ..\lib\c4plib.h mft.h
