## Makefile for Tangle/Weave (Win32 version)		-*- Makefile -*-
## Time-stamp: "97/08/04 00:13:43 mik"

!include ..\miktex.inc

srcdir = .

tangle_web = $(srcdir)\tangle.web
weave_web = $(srcdir)\weave.web

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

all: tangle.exe weave.exe numberit.exe

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

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

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

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

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

tangle.p: $(tangle_web) tangle.win32-changes
	$(TANGLE) $(tangle_web) $(srcdir)\tangle.win32-changes tangle.p nul

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

weave.p: $(weave_web) weave.win32-changes
	$(TANGLE) $(weave_web) $(srcdir)\weave.win32-changes weave.p nul

install: tangle.exe weave.exe numberit.exe
	$(INSTALL_PROGRAM) tangle.exe $(bindir)\tangle.exe
	$(INSTALL_PROGRAM) weave.exe $(bindir)\weave.exe

uninstall:

mostlyclean:
	-del *.obj
	-del *.exe
	-del tangle.res
	-del weave.res
	-del makefile.win32.bak

clean: mostlyclean
	-del weave.c
	-del weave.h
	-del weave.p
	-del *.ilk
	-del *.pdb

distclean: clean
	-del *.opt

realclean: distclean
	-del tangle.c
	-del tangle.h
	-del tangle.p

depend: tangle.c weave.c
	makedepend -f makefile.win32 -I. -I..\lib $**

# DO NOT DELETE

tangle.obj: ..\lib/miktex.h ..\lib/c4plib.h tangle.h
weave.obj: ..\lib/miktex.h ..\lib/c4plib.h weave.h
