source  = ..
include = .;$(source);$(source)\languages\english

.obj: obj
.c:   $(source);$(source)\deformatters;deformatters

obj_mod = ispell.obj correct.obj tree.obj defmt.obj term_os2.obj exp_table.obj fields.obj
obj_nom = dump.obj good.obj hash.obj lookup.obj makedent.obj tgood.obj xgets.obj
compile = wcc386 -zp1 -zc -d1 -os -bm -bt=OS2 -wx -zq -s -i=$(include) -fo=obj\$^.
perv    = lib D:\Work\PERVLIB_OW\WCC003OR opt elimin,case,verb
link    = wlink deb all f {$<} name $* opt q,map,symf,stack=32768 $(perv)

all:	ispell.exe buildhash.exe koi2alt.exe	&
	deformatters\deformat-c.exe		&
	deformatters\deformat-sh.exe		&
	deformatters\deformat-mail.exe		&
	.SYMBOLIC

#	icombine.exe				&

ispell.exe: $(obj_mod) $(obj_nom) gnu_regex.obj
	$(link)

buildhash.exe: buildhash.obj makedent.obj hash.obj y.tab.obj
	$(link)

icombine.exe: icombine.obj makedent.obj y.tab.obj
	$(link)

koi2alt.exe: koi2alt.obj
	$(link)

deformatters\deformat-c.exe: defmt-c.obj
	$(link)

deformatters\deformat-sh.exe: defmt-sh.obj
	$(link)

deformatters\deformat-mail.exe: deformat-mail.obj
	$(link)

ispelld.exe: ispelld.obj
	$(link)

makedent.obj: makedent.c .AUTODEPEND
	$(compile) -zm $<

gnu_regex.obj: gnu_regex.c .AUTODEPEND
	$(compile) -zm -dSTDC_HEADERS $<

y.tab.c: $(source)\parse.y
	\gnu\bin\yacc -l $<

.c.obj: .AUTODEPEND
	$(compile) $<

clean: .SYMBOLIC
	-del *.exe *.map *.sym *.err
	-del obj\*.obj
	-del deformatters\*.exe deformatters\*.map deformatters\*.sym
