File: Makefile

package info (click to toggle)
igerman98 20071211-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,188 kB
  • ctags: 56
  • sloc: sh: 1,277; perl: 938; makefile: 476; sed: 32
file content (483 lines) | stat: -rw-r--r-- 17,385 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# Makefile for the dictionary igerman98
#
# Author: Bjoern Jacke <bjoern@j3e.de>
#
# Copyright: GNU GPLv2

LANGS=de_DE de_AT de_CH
#LANGS2=de_DE de_AT de_CH de_all
LANGS2=$(LANGS) de_all
DATE=`date +%Y%m%d`

all:
	@echo "a default make target doesn't exist any more"
	@echo "you might want to use one of those:"
	@echo "  make hunspell/de_DE.dic hunspell/de_DE.aff (or de_AT or de_CH)"
	@echo "  make myspell/de_DE.dic myspell/de_DE.aff (or de_AT or de_CH)"
	@echo "  make ispell/de_DE.aff ispell/de_DE.hash (or de_AT, de_CH ...)"
	@echo "  make aspell/de_DE TODO (or de_AT, de_CH ...) BROKEN,TODO"
	@echo "  make ligature/rmligs"
	@echo "  make isowordlist-de_DE (or de_AT, de_CH ...)"
	@echo "did I forget an important one ?-)"



#MYLANG = $(shell echo -n $@ | sed "s/^.*_\(de_.*$$\)/\1/")
MYLANG = $(shell echo $@ | sed "s/^.*[_/]\(de_[a-zA-Z]*\).*/\1/")

# FIND_OPTS can be used to exclude directories from being used, like:
# FIND_OPTS = ! -name "*-a-*"

define WORDS_define_template

WORDS_$(1) = $$(shell $$(FIND) ./dicts/ -name "*$(1)*.txt" ! -name "*compound*" $$(FIND_OPTS) -print)

WORDS_COMP_$(1) = $$(shell $$(FIND) ./dicts/ -name "compound*$(1)*.txt" $$(FIND_OPTS) -print)

## alle ohne "*-x*"
WORDS_CAPMAIN_SMALL_$(1)	= $$(shell $$(FIND) ./dicts/ -name "*$(1)*.txt" ! -name "*-x*" ! -name "*compound*" $$(FIND_OPTS) -print)

## alle "*-xx*"
WORDS_CAPMAIN_PLUS_$(1)	= $$(shell $$(FIND) ./dicts/ -name "*$(1)*.txt" -name "*-xx*" ! -name "*compound*" $$(FIND_OPTS) -print)

## alle "*-x*" ohne "*-xx*"
WORDS_NOCAPMAIN_$(1)	= $$(shell $$(FIND) ./dicts/ -name "*$(1)*.txt" -name "*-x*" ! -name "*-xx*" ! -name "*compound*" $(FIND_OPTS) -print)

WORDS_BLACKLISTS_$(1) = $$(shell $$(FIND) ./dicts/ -name "blacklist*$(1)*" $(FIND_OPTS) -print)

endef
$(foreach langcode,$(LANGS2),$(eval $(call WORDS_define_template,$(langcode))))

ISPELLIBDIR = $$($(ISPELL) -vv |grep "LIBDIR" |sed "s/.*\=//" |tr -d \")
DESTDIR =
MAKE = make
FIND = find

# the following is to remove temp files during build. Set it
# to rm if disk space is an issue during build time:
RM_OR_NOT = @\#
#RM_OR_NOT = rm

#ZIP = zip
#ZIP_OPTS = -j -r -9 -X
ZIP = 7z
ZIP_OPTS = a -tzip -mx=9
BUILDHASH = buildhash

ISPELL = ispell
HUNSPELL_BIN = hunspell
# Hunspell starting with 1.1.9 (?) uses automatic charset transcoding,
# we need to make sure we use latin1:
HUNSPELL = $(HUNSPELL_BIN) `$(HUNSPELL_BIN) -h 2>&1 | grep -q "hunspell \\-i" && echo "-i latin1"`

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

ASPELL = aspell
vpath %.txt ./dicts  ./hunspell ./myspell
.SUFFIXES: .txt .dic
.PHONY: clean pack unpack sort help dist clean
SUBDIRS = testdir

# to let `sort' behave right: setting LC_ALL ist not enough, because
# UTF-8 locales won't get overwritten by that, we also need to reset LANG!
# Otherwise locale depending sorting which is slow as hell (like for de_DE) is used.
LANG=C
LC_ALL=C
LC_COLLATE=C


#$(addprefix dicts/,$(WORTE)): unpack
#	echo x
#	test -e $@ || (echo Wortliste $@ nicht vorhanden ; exit 1)



###
## Ispell stuff:
###

ispell/de_AT.aff ispell/de_DE.aff: ispell/de_DE.aff.in
	cp ispell/de_DE.aff.in $@

ispell/de_CH.aff: ispell/de_DE.aff.in
	sed "/swiss-del/d" ispell/de_DE.aff.in |sed "/swiss-convert/s/sS/SS/g" |sed '/\#swiss-only/s/^\#//' |sed '/stringchar/!s/sS//g' > $@


define LANG_ispell_dict_template

ispell/$(1).hash: ispell/$(1).aff all.words.$(1).tmp
	$$(BUILDHASH) all.words.$(1).tmp ./ispell/$(1).aff $$@

all.words.$(1).tmp: all.words.$(1).raw ispell/$(1).aff
	munchlist -l ./ispell/$(1).aff all.words.$(1).raw > $$@

all.words.$(1).raw: $$(WORDS_$(1)) $$(WORDS_de_all) dicts/abkuerzpunkt.txt
	sed "s/qq//g;s/\.//;s/\-.*//" dicts/abkuerzpunkt.txt $$(WORDS_$(1)) $$(WORDS_de_all) \
	| (test -e ./bin/conv_dict_$(1) && ./bin/conv_dict_$(1) || cat) \
	| grep -v "\/.*d" | sort -u > $$@

ispell/$(1)_null.hash: ispell/$(1)_null.aff
	test -e all.words.placebo.tmp || echo a > all.words.placebo.tmp
	$$(BUILDHASH) all.words.placebo.tmp ispell/$(1)_null.aff $$@

isowordlist-$(1): ispell/$(1)_null.hash ispell/$(1)_null.aff all.words.$(1).tmp
	$$(ISPELL) -e -d./ispell/$(1)_null < all.words.$(1).tmp |tr ' ' '\n' |sed -f ./bin/dic2iso |sort -u > $$@

endef
$(foreach langcode,$(LANGS),$(eval $(call LANG_ispell_dict_template,$(langcode))))




###
## Aspell stuff: (unmaintained here since a while ... and unusable atm.)
###

help.hash: german.aff all.words2 .copyright
	$(BUILDHASH) all.words2 ./german.aff $@

all.words2:
	cd dicts; sed s/qq//g $(WORTE) |sort -u > ../$@

aspell: help.hash
	#cat all.words2 dicts/abkuerzpunkt.txt |$(ISPELL) -e -d./help |sed -f ./bin/dic2iso |sort -u |$(ASPELL) --lang=german create master ./german
	sed "s/\.//g" all.words2 dicts/abkuerzpunkt.txt |$(ISPELL) -e -d./help |sed -f ./bin/dic2iso |sort -u |$(ASPELL) --lang=german create master ./german

swiss-aspell: swiss
	cat all.words.swiss |$(ISPELL) -e -d./swiss |sed -f ./bin/dic2iso |sort -u |$(ASPELL) --lang=swiss create master ./swiss

aspell/de_DE_affix.dat: myspell/de_DE.aff
	cp myspell/de_DE.aff $@



define LANG_myspell_template

myspell/$(1).dic: $$(WORDS_$(1)) $$(WORDS_de_all) dicts/abkuerzpunkt.txt
	cat $$(WORDS_$(1)) $$(WORDS_de_all) dicts/abkuerzpunkt.txt \
		| (test -e ./bin/conv_dict_$(1) && ./bin/conv_dict_$(1) || cat) \
		| ./bin/myspell-generic-process.sh  > $$@.tmp
	wc -l < $$@.tmp > $$@
	cat myspell/de_all.dic.header | sed "s/AFF_VERSION_REPLACE/`date +%Y%m%d`/;s/LANG_REPLACE/$(1)/" >> $$@
	./bin/dic2iso < $$@.tmp >> $$@
	$(RM_OR_NOT) $$@.tmp

endef
$(foreach langcode,$(LANGS),$(eval $(call LANG_myspell_template,$(langcode))))



define LANG_aff_template

myspell/$(1).aff: myspell/de_all.aff.in myspell/de_all.aff.header
	cat myspell/de_all.aff.header myspell/de_all.aff.in | sed "s/AFF_VERSION_REPLACE/$$(DATE)/;s/LANG_REPLACE/$(1)/" > $$@

hunspell/$(1).aff: hunspell/de_all.aff.hunspell_additions myspell/de_all.aff.in hunspell/de_all.aff.header
	cat hunspell/de_all.aff.header myspell/de_all.aff.in hunspell/de_all.aff.hunspell_additions | sed "s/AFF_VERSION_REPLACE/$$(DATE)/;s/LANG_REPLACE/$(1)/" > $$@

ispell/$(1)_null.aff: ispell/$(1).aff
	cp ispell/$(1).aff $$@

endef
$(foreach langcode,$(LANGS),$(eval $(call LANG_aff_template,$(langcode))))
	


define LANGS2_hunspell_dicts_template

HUNSPELL_DICTS_BASE_$(1) = hunspell-capmain-small_$(1).tmp hunspell-compdic_$(1).tmp hunspell-end-compdic_$(1).tmp hunspell-middle-compdic_$(1).tmp hunspell-end-compdic_$(1).tmp

#HUNSPELL_DICTS_BASE_$(1) = hunspell-capmain-small_$(1).tmp hunspell-compdic_$(1).tmp hunspell-end-compdic_$(1).tmp hunspell-middle-compdic_$(1).tmp hunspell-end-compdic_$(1).tmp hunspell-capmain-small_de_all.tmp hunspell-compdic_de_all.tmp hunspell-end-compdic_de_all.tmp hunspell-middle-compdic_de_all.tmp hunspell-middle-compdic_de_all.tmp hunspell-end-compdic_de_all.tmp

hunspell-capmain-small_$(1).tmp: $$(WORDS_CAPMAIN_SMALL_$(1))
	# limited dictionary without any *-x* files used to sort out all known words from -xx files
	rm -f $$@.tmp
	echo $$(WORDS_CAPMAIN_SMALL_$(1)) | xargs cat >> $$@.tmp
	./bin/hunspell-capmain $$@.tmp > $$@
	$$(RM_OR_NOT) $$@.tmp


hunspell-nocapmain_$(1).tmp: $$(WORDS_NOCAPMAIN_$(1)) $$(WORDS_NOCAPMAIN_de_all)
	# limited dictionary of all -x (but not -xx) files
	rm -f $$@.tmp
	#find dicts/ -name "*x*.txt" ! -name "*-xx*" -print | xargs cat >> $@.tmp
	echo $$(WORDS_NOCAPMAIN_$(1)) $$(WORDS_NOCAPMAIN_de_all) | xargs cat >> $$@.tmp
	###TODO??? ./bin/dic2iso < $$@.tmp > $$@
	mv $$@.tmp $$@
	#$$(RM_OR_NOT) $$@.tmp

hunspell-middle-compdic_$(1).tmp: dicts/middle-compound.txt
	# more TODO here ?
	sed "s:$$$$:/hkem:;s:/\(.*\)/:/\1:"	< dicts/middle-compound.txt	>  $$@

hunspell-end-compdic_$(1).tmp: dicts/end-compound.txt
	# more TODO here ?
	sed "s:$$$$:/oz:;s:/\(.*\)/:/\1:"		< dicts/end-compound.txt	>  $$@

hunspell-compdic_$(1).tmp: $$(WORDS_COMP_$(1)) $$(WORDS_COMP_de_all)
	# sed hack to add "/"to lines which don't have one yet:
	# sed "/^[^\/]*$$/s/$$/\//"
	echo DEBUG: WORDS_COMP_$(1) :: $$(WORDS_COMP_$(1)) :::
	echo DEBUG: WORDS_COMP_de_all :: $$(WORDS_COMP_de_all) :::
	echo $$(WORDS_COMP_$(1)) $$(WORDS_COMP_de_all) | xargs sed "/^[^\/]*$$$$/s/$$$$/\// ; s/$$$$/hij/"	>  $$@
	echo >> $$@
	#	more TODO here ? (added myspellfixprefix...)
	cat $$(WORDS_COMP_$(1)) $$(WORDS_COMP_de_all) \
		| ./bin/myspellfixprefix.pl \
		| ./bin/lcfirst.pl \
		| sed "/^[^\/]*$$$$/s/$$$$/\//;s/$$$$/hke/"			>> $$@
	echo >> $$@

endef
$(foreach langcode,$(LANGS2),$(eval $(call LANGS2_hunspell_dicts_template,$(langcode))))

define LANG_hunspell_template

HUNSPELL_DICTS_ALL_$(1) = $$(HUNSPELL_DICTS_BASE_$(1)) hunspell-capmain-plus_$(1).tmp hunspell-nocapmain_$(1).tmp dicts/abkuerzpunkt.txt hunspell-blacklist_$(1).tmp \
	$$(HUNSPELL_DICTS_BASE_de_all)

hunspell-blacklist_$(1).tmp: $$(WORDS_BLACKLISTS_$(1)) $$(WORDS_BLACKLISTS_de_all)
	# sed hack to merge /f/g to /fg : sed "s:/\(.*\)/:/\1:"
	cat $$(WORDS_BLACKLISTS_$(1)) $$(WORDS_BLACKLISTS_de_all) >$$@

hunspell-capmain-plus_$(1).tmp: ispell/$(1)_null.aff ispell/$(1)_null.hash hunspell/$(1)_small.dic hunspell/$(1)_small.aff $$(WORDS_CAPMAIN_PLUS_$(1)) $$(WORDS_CAPMAIN_PLUS_de_all)
	echo DEBUG: WORDS_CAPMAIN_PLUS_$(1) :: $$(WORDS_CAPMAIN_PLUS_$(1)) :::
	echo DEBUG: WORDS_CAPMAIN_PLUS_de_all :: $$(WORDS_CAPMAIN_PLUS_de_all) :::
	# limited dictionary of *-xx* files containing compounds not generated by capmain-small
	rm -f $$@.unfiltered-list.tmp
	#find dicts/ -name "*-xx*.txt" -print | xargs cat >> $$@.unfiltered-list.tmp
	echo $$(WORDS_CAPMAIN_PLUS_$(1)) $$(WORDS_CAPMAIN_PLUS_de_all) | xargs cat >> $$@.unfiltered-list.tmp
	# german->de_DE ?
	cat $$@.unfiltered-list.tmp | $$(ISPELL) -d./ispell/$(1)_null -e > $$@.unfiltered-list-expanded.tmp
	./bin/dic2iso < $$@.unfiltered-list-expanded.tmp |sed "s/qq//g" | nl | $$(HUNSPELL) -d hunspell/$(1)_small -L > $$@.unknown.tmp
	sed "s/^ *\([0-9]*\)\t.*$$$$/\1/" $$@.unknown.tmp > $$@.list-unknown-lines.tmp
	./bin/extractlines.pl $$@.list-unknown-lines.tmp $$@.unfiltered-list.tmp > $$@.tmp
	./bin/hunspell-capmain $$@.tmp |./bin/iso2dic > $$@
	$$(RM_OR_NOT) $$@.unfiltered-list.tmp $$@.unfiltered-list-expanded.tmp $$@.unknown.tmp $$@.list-unknown-lines.tmp $$@.tmp


hunspell/$(1)_small.dic: $$(HUNSPELL_DICTS_BASE_$(1)) $$(HUNSPELL_DICTS_BASE_de_all) myspell/de_all.dic.header
	echo $$(HUNSPELL_DICTS_BASE_$(1))
	echo $$(HUNSPELL_DICTS_BASE_de_all)
	cat $$(HUNSPELL_DICTS_BASE_$(1)) $$(HUNSPELL_DICTS_BASE_de_all) \
		| (test -e ./bin/conv_dict_$(1) && ./bin/conv_dict_$(1) || cat) \
		| ./bin/hunspell-generic-process.sh \
		> $$@.tmp
	wc -l < $$@.tmp > $$@
	cat myspell/de_all.dic.header | \
		sed "s/AFF_VERSION_REPLACE/`date +%Y%m%d`/;s/LANG_REPLACE/$(1)/;s/Myspell/Hunspell/" >> $$@
	./bin/dic2iso < $$@.tmp >> $$@
	$(RM_OR_NOT) $$@.tmp

hunspell/$(1)_small.aff: hunspell/$(1).aff
	cp hunspell/$(1).aff $$@

hunspell/$(1).dic: $$(HUNSPELL_DICTS_ALL_$(1)) $$(HUNSPELL_DICTS_ALL_de_all) myspell/de_all.dic.header
	echo a $$(HUNSPELL_DICTS_ALL_$(1))
	echo b $$(HUNSPELL_DICTS_ALL_de_all)
	cat $$(HUNSPELL_DICTS_ALL_$(1)) $$(HUNSPELL_DICTS_ALL_de_all) \
		| (test -e ./bin/conv_dict_$(1) && ./bin/conv_dict_$(1) || cat) \
		| ./bin/hunspell-generic-process.sh	\
		| ./bin/hunspell-optimize-roothelper.pl	\
		> $$@.tmp
	wc -l < $$@.tmp > $$@
	cat myspell/de_all.dic.header | sed "s/AFF_VERSION_REPLACE/`date +%Y%m%d`/;s/LANG_REPLACE/$(1)/;s/Myspell/Hunspell/" >> $$@
	./bin/dic2iso < $$@.tmp >> $$@
	$(RM_OR_NOT) $$@.tmp



endef
$(foreach langcode,$(LANGS),$(eval $(call LANG_hunspell_template,$(langcode))))

# -x dictionaries should not be compounded via capmain
# -xx dictionaries should be "cleaned up" before being compounded via capmain


myspell-zip: myspell/de_DE.aff myspell/de_DE.dic myspell/de_AT.aff myspell/de_AT.dic myspell/de_CH.aff myspell/de_CH.dic
	date +%Y%m%d > myspell/VERSION
	cd myspell; \
	for lang in de_DE de_AT de_CH ; do \
		rm -f $$lang-`cat VERSION`.zip ; \
		$(ZIP) $(ZIP_OPTS) $$lang-`cat VERSION`.zip -i@$$lang.zip.files ; \
	done

hunspell-zip: hunspell/de_DE.aff hunspell/de_DE.dic hunspell/de_AT.aff hunspell/de_AT.dic hunspell/de_CH.aff hunspell/de_CH.dic
	date +%Y%m%d > hunspell/VERSION
	cd hunspell; \
	for lang in de_DE de_AT de_CH ; do \
		rm -f $$lang-`cat VERSION`.zip ; \
		$(ZIP) $(ZIP_OPTS) $$lang-`cat VERSION`.zip -i@$$lang.zip.files ; \
	done

huntest: hunspell/hunspell-test.txt
	# huntest fails with "BREAK -" but that is needed for US-Wirtschaft etc.
	# so this is the lesser evil. No perfect solution found so far...
	cat hunspell/hunspell-test.txt |$(HUNSPELL) -L -d hunspell/de_DE > $@.tmp 2>&1
	@if `grep -q "^0 " $@.tmp`;then echo "Huntest NICHT bestanden:"; cat $@.tmp; exit 1;fi
	@if ! test "`wc -l < $@.tmp`" = "`tail -n 1 $@.tmp | cut -f1 -d:`";then echo "Huntest NICHT bestanden (Zu viele als korrekt erkannte Wrter):"; cat $@.tmp; exit 1;fi


###
## ligature stuff:
###


ligature/liglist.aff: ispell/de_DE.aff.in
	sed '/\#qqq/s/^\#//g;/\#nnn/d' ispell/de_DE.aff.in > $@

all.words.liglist.raw.tmp: $(foreach langcode,$(LANGS2),$(WORDS_$(langcode)))
	sed "s/\.//" $(foreach langcode,$(LANGS2),$(WORDS_$(langcode))) |sort -u > $@

all.words.liglist.tmp: all.words.liglist.raw.tmp ligature/liglist.aff
	munchlist -l ./ligature/liglist.aff all.words.liglist.raw.tmp > $@

ligature/liglist.hash: ligature/liglist.aff all.words.liglist.tmp
	$(BUILDHASH) all.words.liglist.tmp ./ligature/liglist.aff $@

liglist.tmp: ligature/liglist.hash all.words.liglist.tmp
	cat ligature/oldspell.liglist all.words.liglist.tmp \
	| $(ISPELL) -e -d./ligature/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                                      \
	| sed -f ./bin/dic2iso                             \
	| tr A-Z a-z                                       \
	| sort -u                                          \
	> $@

ligature/rmligs: liglist.tmp ligature/rmligs.skel
	cat ligature/rmligs.skel liglist.tmp > $@
	chmod 755 $@






###
## misc stuff:
###

clean:
	rm -f all.words* igerman98*.tar.bz2 isowordlist* MD5sums
	#sort liglist.aff  MD5sums myspell/*.dic de_DE.zip de_CH.zip myspell/VERSION *.tmp
	rm -f ispell/*.aff ispell/*.hash
	rm -f myspell/*.dic  myspell/*.aff  myspell/*.zip
	rm -f hunspell/*.dic hunspell/*.aff hunspell/*.zip
	rm -f ligature/liglist.* ligature/rmligs
	find . -name "*tmp*" -print |xargs rm -f

sort:
	@if grep [] dicts/*.txt ;then echo "!!! wrong characters in dictionay files !!!";exit 1;fi
	$(FIND) ./dicts/ -name "*.txt" -print | while read i; do sort -u -o "$$i" "$$i"; done

pack: sort
	exit 1
	rm -f unpack
	cd dicts; $(FIND) . -name "*.txt" -print |while read i; do test -e $$i.sq && exit 1; $(SQ) < $$i > $$i.sq && rm $$i; done

unpack:
	exit 1
	cd dicts; $(FIND) . -name "*.sq" -print | while read i; do test -e `basename $$i .sq` && exit 1; $(UNSQ) < $$i > `basename $$i .sq` && rm $$i; done
	touch unpack

dist: sort clean
	date +%Y%m%d > VERSION
	md5sum -- `$(FIND) . -name "*" -xtype f -print` | gpg --clearsign > .MD5sums
	mv .MD5sums MD5sums
	ls > .files
	echo igerman98-`cat VERSION` > .name
	mkdir `cat .name`
	mv `cat .files` `cat .name`
	tar cv * | bzip2 -9 > `cat .name`.tar.bz2
	mv `cat .name`/* .
	rmdir `cat .name`





###########################
### TEST TRASH follows: ###
###########################

help_test:
	grep "^[[:alpha:]\-]*:"  Makefile | cut -d " " -f 1

test0:
	export BLA=FOO

LIST_FOO = eins zwei drei

eins:

#zwei: $($(WORTE_NEU))
# $(addprefix dicts/,$(WORTE))
zwei: $(WORDS_GENERIC)
	echo $(WORDS_GENERIC)
	touch zwei

drei:
	echo $(WORDS_NOCAPMAIN)
	$(RM_OR_NOT) bla

test1: test0 $(LIST_FOO) testdir/de_DE.dic
	echo $$BLA
	echo $(LIST_FOO)

#FOO_de_DE FOO_de_AT FOO_de_CH FOO_de_all: WORDS_$(subst FOO_,,$@)
#FOO_de_DE FOO_de_AT FOO_de_CH FOO_de_all : MYLANG=$(subst FOO_,,$@)
#FOO_de_DE FOO_de_AT FOO_de_CH FOO_de_all : MYLANG=$(shell echo $@ |sed s/.*_\(de_.*\)/\1/)
#FOO_de_DE FOO_de_AT FOO_de_CH FOO_de_all : MYLANG=$(shell echo $@|sed "s/^.*_\(de_.*$$\)/\1/")
#FOO_de_DE FOO_de_AT FOO_de_CH FOO_de_all: $(FOO_%: WORDS_%)
FOO_de_DE FOO_de_AT FOO_de_CH FOO_de_all: $(WORDS_$(MYLANG)) $(HUNSPELL_DICTS_BASE_$(MYLANG))
	#set MYLANG=$(subst FOO_,,$@)
	echo target: $@
	echo MYLANG: $(MYLANG)
	#echo $(WORDS_$(subst FOO_,,$@))
	echo $(WORDS_$(MYLANG))
	echo $<

WORDS_de_aa = $(WORDS_shell)
WORDS_de_bb = $(WORDS_shell)

SUB_de_aa SUB_de_bb: $(WORDS_$(MYLANG))
	@echo SUB says WORDS is: $(MYLANG)
	@echo SUB says lang is: $(lang)

define MYDEF
$(1): lang_def=hallo
endef

test2_de_aa test2_de_bb: lang=$(MYLANG)
#test2_de_aa: SUB_
#test2_de_aa test2_de_bb: $$(SUB_$(MYLANG))
test2_de_aa test2_de_bb: $(eval $(call MYDEF,$(@)))
	#$(subst LANG,$(lang),SUB_LANG)
	@echo MYLANG: $(MYLANG)
	@echo lang: $(lang)
	@echo lang_def: $(lang_def)
	@echo I think WORDS is: $(WORDS_$(MYLANG))

TESTLANGS=de_aa de_bb de_DE

define LANG_testtemplate
$(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
	echo aa
test3_$(1): SUB_$(1)
	@echo MYLANG: $(MYLANG)
	@echo I think WORDS is: $(WORDS_$(MYLANG))
	@echo I think I am $$@

ALL_OBJS   += $$($(1)_OBJS)
endef

$(foreach langcode,$(TESTLANGS),$(eval $(call LANG_testtemplate,$(langcode))))