WORTE = \
	mlatin.dico
# not used:


MAKE = make
BUILDHASH = buildhash
ISPELL = ispell
SQ = sq
UNSQ = unsq
#   if for some reason you don't have Ispell's unsq use my Perl sq/unsq
#  and put it into a directory known by your PATH variable!
#UNSQ = unsq.pl

# to let `sort' behave more sane:
LC_ALL = POSIX
LC_COLLATE = POSIX





###
## Ispell stuff:
###

latin.hash: latin.aff all.words copyright
	$(BUILDHASH) all.words latin.aff $@

all.words: unpack
	cat mlatin.dico |sort -u > $@

install: latin.hash
	cp latin.aff latin.hash `$(ISPELL) -vv |grep LIBDIR  |sed "s/.*\=//" |tr -d \"`




###
## misc stuff:
###


copyright:
	@echo 
	@cat Documentation/Copyright
	@sleep 6

isowordlist: latin.hash
	cat all.words |$(ISPELL) -e -d./latin |tr \  '\n' |sort -u > isowordlist
	#cat all.words |$(ISPELL) -e -d./latin |tr \  '\n' |sed -f ./bin/dic2iso |sort -u > isowordlist


clean:
	rm -f all.words* *.hash iroma*.tar.bz2 *isowordlist MD5sums

sort:
	#cd dicts; find . -name "*.txt" |while read i; do sort -u -o $$i $$i; done

pack: sort
	#cd dicts; find . -name "*.txt" |while read i; do $(SQ) < $$i > $$i.sq && rm $$i; done

unpack:
	#cd dicts; find . -name "*.sq" |while read i; do $(UNSQ) < $$i > `basename $$i .sq` && rm $$i; done

dist: clean sort pack
	date +%Y%m%d > VERSION
	md5sum `find . -name "*" -xtype f` |gpg --clearsign > .MD5sums
	mv .MD5sums MD5sums
	ls > .files
	echo iroma-`cat VERSION` > .name
	mkdir `cat .name`
	mv `cat .files` `cat .name`
	tar cv * | bzip2 > `cat .name`.tar.bz2
	mv `cat .name`/* .
	rmdir `cat .name`

