I = /usr/include

all: /usr/dict/all hlists

hlists: /usr/dict/hash/american /usr/dict/hash/british /usr/dict/hash/stop

speller:	speller.o
	cc -n $(CFLAGS) -o speller speller.o; rm speller.o
speller.o:	speller.c	spell.h $I/stdio.h $I/ctype.h 
/usr/lib/speller:	speller
	/etc/instcmd speller /usr/lib/speller

spellin:	spellin.o
	cc -n $(CFLAGS) -o spellin spellin.o; rm spellin.o
spellin.o:	spellin.c	spell.h $I/stdio.h $I/ctype.h 

spellout:	spellout.o
	cc -n $(CFLAGS) -o spellout spellout.o; rm spellout.o
spellout.o:	spellout.c	spell.h $I/stdio.h $I/ctype.h 

/usr/dict/all: /usr/dict/words /usr/dict/american \
	       /usr/dict/local /usr/dict/british
	make.all

/usr/dict/hash/american: /usr/dict/american /usr/dict/local hash
	(cat /usr/dict/american /usr/dict/local) | spellin hash > /usr/dict/hash/american
/usr/dict/hash/british:  /usr/dict/british  /usr/dict/local hash
	(cat /usr/dict/british  /usr/dict/local) | spellin hash > /usr/dict/hash/british
/usr/dict/hash/stop: /usr/dict/stop
	spellin < /usr/dict/stop > /usr/dict/hash/stop

hash: /usr/dict/words
	spellin < /usr/dict/words > hash
