WORTE =	abkuerz.txt \
	abkuerz2.txt \
	adjektive.txt \
	alphabeta.txt \
	anglizismen.txt \
	compeng.txt \
	elektronik.txt \
	geogra2.txt \
	geographie.txt \
	infoabk.txt \
	informatik.txt \
	klein.txt \
	latein.txt \
	marken.txt \
	mathe.txt \
	namen.txt \
	neualternativ.txt \
	orgabk.txt \
	roemisch.txt \
	seltenes.txt \
	technik.txt \
	verben.txt \
	vornam2.txt \
	vornamen.txt \
	worte.txt \
	worte2.txt \
	zusammen.txt
# not used: oesterreich.txt


###
## Ispell and Aspell stuff:
###

german.hash: all.words copyright
	buildhash all.words german.aff $@

all.words: $(WORTE)
	sed s/qq//g $+ | sort -u > $@

install: german.hash
	cp german.aff german.hash `ispell -vv|grep LIBDIR|sed "s/.*\=//" |tr -d \"`

aspell: german.hash
	cat all.words | ispell -e -d./german | ./dic2iso | sort -u | aspell --lang=german create master ./german


###
## ligature stuff:
###

liglist.aff:
	sed '/\#qqq/s/^\#//g;/\#nnn/d' german.aff > liglist.aff

all.words.liglist: $(WORTE)
	sort -u $+ > $@

liglist.hash: liglist.aff all.words.liglist
	buildhash all.words.liglist liglist.aff $@

liglist: liglist.hash copyright
	cat oldspell.liglist all.words.liglist             \
	| ispell -e -d./liglist                            \
	| tr \  '\n'                                       \
	| grep qq                                          \
	| sort -u                                          \
	| sed 's/fqqf/f\|f/g;s/fqql/f\|l/g;s/fqqi/f\|i/g'  \
	| grep \|                                          \
	| sed s/qq//g                                      \
	| ./dic2iso                                        \
	| tr A-Z a-z                                       \
	| sort -u                                          \
	> liglist

rmligs: liglist
	cat rmligs.skel liglist > rmligs
	chmod 755 rmligs

###
## misc stuff:
### 

copyright:
	@echo 
	@cat Copyright
	@sleep 8

isowordlist: german.hash
	cat all.words | ispell -e -d./german | tr \  '\n' | ./dic2iso | sort -u > isowordlist

clean:
	rm -f all.words* german.hash igerman98*.tar.gz isowordlist german.sl german.wrd liglist.aff all.words.liglist liglist.hash liglist MD5sums

sort:
	for i in *.txt;do sort -u -o $$i $$i;done

dist:	clean sort
	md5sum * | gpg --clearsign > MD5sums
	tar cv * | gzip > igerman98-`cat VERSION`.tar.gz

