#
# Simple Makefile to integrate this language into
# SUSE Linux
#
BUILDHASH	=	buildhash
LIBDIR		=	/usr/lib/ispell
MAKE_SORTTMP	=	-T /var/tmp
FIX8BIT		=	../fix8bit

DICTALWAYS	= worte.txt \
		  verben.txt \
		  adjektive.txt \
		  klein.txt \
		  imperat.txt \
		  abkuerz.txt \
		  vornamen.txt \
		  geographie.txt \
		  latein.txt \
		  oesterreich.txt \
		  informatik.txt \
		  infoabk.txt \
		  elektronik.txt \
		  alphabeta.txt \
		  roemisch.txt \
		  orgabk.txt \
		  marken.txt

DICTXLARGE	= worte2.txt \
		  zusammen.txt \
		  technik.txt \
		  compeng.txt \
		  geogra2.txt \
		  vornam2.txt \
		  namen.txt

AFFIXES		=	deutsch.aff
PACKNAME	=	ispell-german
DOCDIR		=	/usr/share/doc/packages/$(PACKNAME)
DOCSOURCE	=	README ANNOUNCE Changes Contributors ../README.SUSE


all:	deutschmed.hash deutschlxg.hash

install: all
	-test -s $(DESTDIR)$(LIBDIR)/$(AFFIXES) || install -m 0644 $(AFFIXES) $(DESTDIR)$(LIBDIR)
	install -m 0644 deutschmed.hash deutschlxg.hash $(DESTDIR)$(LIBDIR)
	-ln -sf deutschlxg.hash $(DESTDIR)$(LIBDIR)/deutsch.hash
	mkdir -p $(DESTDIR)$(DOCDIR)
	install -m 0444 $(DOCSOURCE) $(DESTDIR)$(DOCDIR)/

deutschmed.hash: $(AFFIXES) deutsch.med
	rm -f deutschmed.hash
	$(BUILDHASH) deutsch.med $(AFFIXES) deutschmed.hash

deutschlxg.hash: $(AFFIXES) deutsch.lxg
	rm -f deutschlxg.hash
	$(BUILDHASH) deutsch.lxg $(AFFIXES) deutschlxg.hash

$(AFFIXES):	deutsch.aff-hk $(FIX8BIT)
	$(FIX8BIT) -8 < deutsch.aff-hk > $(AFFIXES)

$(FIX8BIT): ../fix8bit.c
	cd ../ ; $(MAKE) fix8bit

deutsch.med:	$(DICTALWAYS) README $(AFFIXES)
	LC_CTYPE=de_DE.ISO-8859-1 ; export LC_CTYPE ; \
	eval sort -u -t/ -k 1f,1 -k 1 $(MAKE_SORTTMP) -o deutsch.med $(DICTALWAYS)

deutsch.lxg:	$(DICTALWAYS) $(DICTXLARGE) README $(AFFIXES)
	LC_CTYPE=de_DE.ISO-8859-1 ; export LC_CTYPE ; \
	eval sort -u -t/ -k 1f,1 -k 1 $(MAKE_SORTTMP) -o deutsch.lxg $(DICTALWAYS) $(DICTXLARGE)

clean:
	rm -f core *.hash *.stat *.cnt

