## Makefile for C4P (Win32 version)			-*- Makefile -*-
## Time-stamp: "97/08/04 00:09:51 mik"

!include ..\miktex.inc

srcdir = .

YACC = bison
YACCFLAGS =
LEX = flex
LEXFLAGS =

OBJECTS = main.obj gram.obj scan.obj output.obj subrange.obj symtab.obj \
		type.obj misc.obj

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

all: c4p.exe

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

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

scan.c: scan.l
	$(LEX) -t $(LEXFLAGS) scan.l > $@

gram.c gram.h: gram.y
	$(YACC) -y -d $(YACCFLAGS) gram.y
	-del gram.c
	-del gram.h
	move y.tab.c gram.c
	move y.tab.h gram.h

install: c4p.exe

uninstall:

mostlyclean:
	-del *.obj
	-del c4p.res

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

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

realclean: clean
	-del gram.c
	-del gram.h
	-del scan.c

depend: main.c output.c subrange.c symtab.c type.c misc.c \
		gram.c gram.h scan.c
	makedepend -f makefile.win32 -I. -I..\lib $**

# DO NOT DELETE

main.obj: ..\lib/getopt.h common.h c4p.rc
main.obj: ..\lib/miktex.version
main.obj: ..\lib/version.h
output.obj: common.h
subrange.obj: common.h
symtab.obj: common.h gram.h
type.obj: common.h gram.h
misc.obj: common.h
gram.obj: common.h
scan.obj: common.h gram.h
