File: Makefile

package info (click to toggle)
igerman98 20051113-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,036 kB
  • ctags: 32
  • sloc: sh: 2,714; perl: 882; makefile: 379; sed: 31
file content (335 lines) | stat: -rw-r--r-- 10,316 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
WORTE = \
	adjektive-a.txt \
	anglizismen-a.txt \
	verben-a.txt \
	klein-a.txt \
	worte-a.txt \
	\
	adjektive-n.txt \
	anglizismen-n.txt \
	klein-n.txt \
	verben-n.txt \
	worte-n.txt \
	\
	abkuerzungen.txt \
	abkuerz2.txt \
	adjektive.txt \
	alphabeta.txt \
	anglizismen.txt \
	compeng.txt \
	elektronik.txt \
	franzoesisch.txt \
	geografie.txt \
	infoabk.txt \
	informatik.txt \
	klein.txt \
	latein.txt \
	marken.txt \
	mathematik.txt \
	namen.txt \
	orgabk.txt \
	roemisch.txt \
	seltenes.txt \
	technik.txt \
	verben.txt \
	vornamen.txt \
	worte.txt \
	worte2.txt \
	zahlen.txt \
	zahlen-ordinal.txt \
	zusammen-klein.txt \
	vornamen2.txt \
	namen2.txt \
	medizin.txt \
	geografie2.txt
#	zusammen-gross.txt \
# not used:   austriazismen.txt
#             helvetismen.txt (automatically used by "make swiss.hash")
#             fixwords.txt (used below)
#             abkuerzpunkt.txt (special treatment below)

ISPELLIBDIR = $$(ispell -vv |grep "LIBDIR" |sed "s/.*\=//" |tr -d \")
DESTDIR =
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

ASPELL = aspell
vpath %.txt ./dicts
.SUFFIXES: .txt

# 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!
LANG = C
LC_ALL = C
LC_COLLATE = C





###
## Ispell stuff:
###

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

all.words.raw: unpack $(addprefix dicts/,$(WORTE))
	cd dicts; sed "s/qq//g;s/\.//;s/\-.*//" abkuerzpunkt.txt $(WORTE) |sort -u |../bin/uniqflag.pl > ../$@.tmp
	mv $@.tmp $@

all.words: all.words.raw german.aff
	munchlist -l ./german.aff all.words.raw > $@

install: german.hash
	mkdir -p $(DESTDIR)$(ISPELLIBDIR)
	cp german.aff german.hash $(DESTDIR)$(ISPELLIBDIR)

# blacklist dict for compound support usage: (not really usable with Ispell)

germanbl.aff:
	cp german.aff germanbl.aff

germanbl.hash: germanbl.aff all.words.germanbl
	$(BUILDHASH) all.words.germanbl ./germanbl.aff germanbl.hash

all.words.germanbl.raw: unpack
	cd dicts; sed "s/[ #\-].*//" blacklist |sort -u |../bin/uniqflag.pl > ../$@.tmp
	mv $@.tmp $@

all.words.germanbl: all.words.germanbl.raw germanbl.aff
	munchlist -l ./germanbl.aff all.words.germanbl.raw > $@

germanbl-install: germanbl.hash
	mkdir -p $(DESTDIR)$(ISPELLIBDIR)
	cp germanbl.aff germanbl.hash $(DESTDIR)$(ISPELLIBDIR)

# compound dictionary: in ispell

all.words.germancomp: dicts/compound.txt
	cp dicts/compound.txt $@

germancomp.hash: all.words.germancomp
	$(BUILDHASH) all.words.germancomp ./germancomp.aff germancomp.hash

## Swiss Ispell stuff:

swiss.aff:
	sed "/swiss-del/d" german.aff |sed "/swiss-convert/s/sS/SS/g" |sed '/\#swiss-only/s/^\#//' |sed '/stringchar/!s/sS//g' > swiss.aff

all.words.swiss.raw: unpack $(addprefix dicts/,$(WORTE))
	cd dicts; sed "s/qq//g;s/sS/ss/g;s/\.//g" $(WORTE) helvetismen.txt abkuerzpunkt.txt |sort -u > ../$@

all.words.swiss: all.words.swiss.raw swiss.aff
	munchlist -l ./swiss.aff all.words.swiss.raw > $@

swiss.hash: swiss.aff all.words.swiss .copyright
	$(BUILDHASH) all.words.swiss ./swiss.aff swiss.hash

swiss-install: swiss.hash
	mkdir -p $(DESTDIR)$(ISPELLIBDIR)
	cp swiss.aff swiss.hash $(DESTDIR)$(ISPELLIBDIR)


###
## Aspell stuff:
###

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

all.words2: unpack
	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




###
## myspell stuff:
###

myspelldic: all.words.raw
#	cd dicts; sed "s/qq//g" abkuerzpunkt.txt $(WORTE) |sort -u |../bin/myspellfixprefix.pl |sort -u |../bin/uniqflag.pl > ../all.words.myspell
	cat all.words.raw dicts/abkuerzpunkt.txt |sort -u |./bin/myspellfixprefix.pl |sort -u  > all.words.myspell
	wc -l all.words.myspell |sed "s/ *\([0-9]*\) .*/\1/g" >myspell/de_DE.dic
	./bin/dic2iso <all.words.myspell >>myspell/de_DE.dic
	sed "s/qq//g" dicts/austriazismen.txt |sort -u |./bin/myspellfixprefix.pl |sort -u |./bin/uniqflag.pl > all.words.myspell.aust
	wc -l all.words.myspell.aust |sed "s/ *\([0-9]*\) .*/\1/g" >myspell/de_AT.dic
	./bin/dic2iso <all.words.myspell.aust >>myspell/de_AT.dic
	
swiss-myspelldic: all.words.swiss.raw
	cat all.words.swiss.raw dicts/abkuerzpunkt.txt dicts/helvetismen.txt |sort -u |./bin/myspellfixprefix.pl |sort -u |./bin/uniqflag.pl > all.words.myspell.swiss
	wc -l all.words.myspell.swiss |sed "s/ *\([0-9]*\) .*/\1/g" >myspell/de_CH.dic
	./bin/dic2iso <all.words.myspell.swiss >>myspell/de_CH.dic

myspell-zip: myspelldic swiss-myspelldic
	rm -f de_DE.zip de_CH.zip
	date +%Y%m%d > myspell/VERSION
	zip -j -r -9 -X de_DE.zip myspell/ -x "*de_CH*"
	zip -j -r -9 -X de_CH.zip myspell/ -x "*de_DE*" -x "*de_AT*"

###
## hunspell stuff:
###

hunspell: hunspell-aff hunspell-capmain.tmp hunspell-compdic.tmp hunspell-bl.tmp hunspell-end-compdic.tmp
	#cat hunspell-capmain.tmp hunspell-compdic.tmp hunspell-bl.tmp |sort -u > hunspell/neu.dic
	cat	hunspell-capmain.tmp \
		hunspell-compdic.tmp \
		hunspell-bl.tmp \
		dicts/abkuerzpunkt.txt \
		hunspell-end-compdic.tmp \
		| sed "s/qq//g" \
		|./bin/myspellfixprefix.pl \
		| sort -u  				> all.words.hunspell
	wc -l all.words.hunspell |sed "s/ *\([0-9]*\) .*/\1/g" > hunspell/de_DE.dic
	./bin/dic2iso <all.words.hunspell >>hunspell/de_DE.dic
# austria:
	sed "s/qq//g" dicts/austriazismen-de_at.txt |sort -u |./bin/myspellfixprefix.pl |sort -u |./bin/uniqflag.pl > all.words.hunspell.aust
	wc -l all.words.hunspell.aust |sed "s/ *\([0-9]*\) .*/\1/g" > hunspell/de_AT.dic
	./bin/dic2iso <all.words.hunspell.aust >> hunspell/de_AT.dic
#	cat hunspell-capmain.tmp hunspell-compdic.tmp hunspell-bl.tmp >> hunspell/de_DE.dic

hunspell-aff:
	cat myspell/de_DE.aff hunspell/de_DE_hunspell_additions.aff > hunspell/de_DE.aff
	cat myspell/de_CH.aff hunspell/de_DE_hunspell_additions.aff > hunspell/de_CH.aff

#hunspell-de_de.aff:
	#sed "s/#hs/COMPOUNDBEGIN x\nCOMPOUNDMIDDLE y\nCOMPOUNDEND z\nFORBIDDENWORD d/" < myspell/de_DE.aff > hunspell/de_DE.aff2
	#sed "s/#hs/COMPOUNDBEGIN x\nCOMPOUNDMIDDLE y\nCOMPOUNDEND z\nFORBIDDENWORD d/" < myspell/de_CH.aff > hunspell/de_CH.aff2

hunspell-end-compdic.tmp:
	sed "s:$$:/oz:"		< dicts/end-compound.txt	>  $@

hunspell-compdic.tmp:	all.words.germancomp
	sed "/^[^\/]*$$/s/$$/\//;s/$$/ox/"	< all.words.germancomp	>  $@
	./bin/lcfirst.pl	< all.words.germancomp \
		| sed "/^[^\/]*$$/s/$$/\//;s/$$/oy/"			>> $@
		
hunspell-compdic.tmpold:	all.words.germancomp
	sed "s:$$:/ox:"		< all.words.germancomp	>  $@
	./bin/lcfirst.pl	< all.words.germancomp \
		| sed "s:$$:/oy:"			>> $@

hunspell-bl.tmp: all.words.germanbl.raw
	# sed hack to merge /f/g to /fg :
	# sed "s:/\(.*\)/:/\1:"
	sed "s:$$:/d:;s:/\(.*\)/:/\1:" < all.words.germanbl.raw > $@

hunspell-capmain.tmp:
	rm -f $@
	find dicts/ -name "*-de_all*.txt" \
	| grep -v -- "-x" \
	| while read a; do \
		grep "^[A-Z]" $$a \
		| ./bin/lcfirst.pl \
		| sed "s:$$:/oz:;s:/\(.*\)/:/\1:"	>> hunspell-capmain.tmp ;\
	done
	cat dicts/*-de_all*.txt >> hunspell-capmain.tmp


hunspell-zip: hunspell
	rm -f de_DE.zip de_CH.zip
	date +%Y%m%d > hunspell/VERSION
	zip -j -r -9 -X de_DE.zip hunspell/ -x "*de_CH*" -x "*addit*"
	zip -j -r -9 -X de_CH.zip hunspell/ -x "*de_DE*" -x "*de_AT*" -x "*addit*"
	mv de_DE.zip de_CH.zip hunspell/

###
## ligature stuff:
###


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

all.words.liglist.raw: unpack $(addprefix dicts/,$(WORTE))
	cd dicts ; sed "s/\.//" *.txt |sort -u > ../$@

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

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

liglist: liglist.hash .copyright
	cat ligature/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                                      \
	| sed -f ./bin/dic2iso                             \
	| tr A-Z a-z                                       \
	| sort -u                                          \
	> liglist

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






###
## misc stuff:
###


.copyright:
	@echo 
	@cat Documentation/Copyright
	@sleep 0

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

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

clean:
	rm -f all.words* *.hash swiss.aff igerman98*.tar.bz2 *isowordlist german swiss unpack sort liglist.aff liglist.hash liglist rmligs MD5sums {myspell,hunspell}/*.dic {myspell,hunspell}/*.zip {myspell,hunspell}/VERSION *.tmp

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

pack: sort
	rm -f unpack
	cd dicts; find . -name "blacklist*" "*.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
	touch unpack

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

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