INTERPRETER=../bin/ocomal.exe
RUNTIME=../bin/ocomrun.exe
TESTS=../bin/ocomtest.exe

OBJ=	pdcpars.obj	pdcmain.obj	pdcmisc.obj	pdccmd.obj 	\
	pdclexs.obj 	pdcid.obj 	pdcscan.obj	pdcparss.obj	\
	pdcenv.obj	pdcsym.obj	pdcexec.obj	pdclist.obj	\
	pdcfree.obj	pdccloop.obj	pdcexp.obj	pdcmem.obj	\
	pdcsqash.obj	pdcstr.obj	pdcprog.obj	pdcext.obj	\
	pdcseg.obj	pdclex.obj	pdcval.obj	pdcmsdos.obj	\
	pdcrun.obj	pdcmod.obj	pdccomp.obj	pdccexp.obj	\
	pdctests.obj	pdcdsys.obj

COPTS=-c -DOS_MSDOS -ml -w-pro -DYY_NO_UNISTD_H
DEBUGOPTS=-v
CC=bcc

.c.obj:
		$(CC) $(COPTS) $(DEBUGOPTS) $*.c

target:		$(INTERPRETER) $(RUNTIME) $(TESTS) mapdel

mapdel:
		echo del ..\\bin\\*.map

tests:		$(TESTS)
		$(TESTS) ../samples/tests

clean:		mapdel
		del *.obj
		del ..\\bin\\*.exe

dosprep:	pdcpars.c pdclex.c

pdcpars.c:	pdcpars.y
		bison -vd pdcpars.y
		mv pdcpars.tab.c pdcpars.c
		mv pdcpars.tab.h pdcpars.h

pdclex.c:	pdclex.l
		flex pdclex.l
		mv lex.yy.c pdclex.c

$(INTERPRETER):	$(OBJ) tlink3.in
		tlink @tlink3.in

$(RUNTIME):	$(OBJ) tlink4.in
		tlink @tlink4.in

$(TESTS):	$(OBJ) tlink5.in
		tlink $(DEBUGOPTS) @tlink5.in
