.SUFFIXES: .exe .obj .c .asm .l .y .ec .h .bat

AS	= masm
ASFLAGS	= /t
YACC	= bison
YFLAGS	=
CC	= cl 
CFLAGS	= $(CL)
LEX	= lex
LFLAGS	= -I
LINK	= link

.asm.exe:
	$(AS) $(ASFLAGS) $< \;
	$(CC) -o $@ $*.obj
	@rm -f $*.obj

.asm.obj:
	$(AS) $(ASFLAGS) $< \;

.c.exe:
	$(CC) $(CFLAGS) $<
	@rm -f $*.obj

.c.obj:
	$(CC) $(CFLAGS) -c $<

.obj.exe:
	$(CC) $*.obj $(CFLAGS) 

.l.exe:
	$(LEX) $(LFLAGS) -t $< > $*.c
	$(CC) -o $@ $*.c
	@rm -f $*.obj $*.c

.l.c:
	$(LEX) $(LFLAGS) -t $< > $@

.l.obj:
	$(LEX) $(LFLAGS) -t $< > $*.c
	$(CC) -c $< $(CFLAGS) 
	@rm -f $*.c

.y.exe:
	$(YACC) $(YFLAGS) $<
	$(CC) -o $@ $*.c $(CFLAGS) 
	@rm -f $*.obj $*.c

.y.c:
	$(YACC) $(YFLAGS) $<

.y.obj:
	$(YACC) $(YFLAGS) $<
	$(CC) -c $*.c $(CFLAGS) 
	@rm -f $*.c
