File: Makefile

package info (click to toggle)
ispell-uk 1.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,536 kB
  • ctags: 70
  • sloc: makefile: 372; sh: 252; perl: 214; awk: 31; xml: 20; python: 19; sed: 4
file content (71 lines) | stat: -rw-r--r-- 2,672 bytes parent folder | download | duplicates (2)
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
include ../encodings.inc

LC_ALL	= LC_ALL=uk_UA.$(SOURCE_ENC)
sort	= $(LC_ALL) sort
spcr	= tr ' ' '\n'

CLEANFILES	= *.lst *.srt *.diff *.dups *.nodups
DISTCLEANFILES	= *.old

wordlist_src = ../src/Dictionary/uk_words.out
iconv	= iconv

VERSION=$(shell cat ../VERSION)
DIST = ../dist
ASPELL_DIST = $(DIST)/aspell-uk-$(VERSION)
ASPELL_DICT = $(shell pwd)/../dist/aspell-uk-$(VERSION)
MYSPELL_DICT = $(shell pwd)/../dist/myspell-uk-$(VERSION)/uk_UA | grep "[а-яіїєґ]"


#LIST_CMD=LC_ALL=uk_UA.UTF-8 aspell list -l uk --dict-dir=$(ASPELL_DICT)
LIST_CMD=hunspell -l -d $(MYSPELL_DICT)

all: 	regtest-aspell

#	cat $(wordlist_src) | $(LC_ALL) aspell expand -l uk --local-data-dir=../ > all_aspell.lst
all_aspell_lst:
	make -C ..
	cat $(wordlist_src) | aspell expand -l uk --local-data-dir=$(ASPELL_DIST) --encoding=$(SOURCE_ENC) > all_aspell.lst

regtest:	all_aspell_lst
	cat all_aspell.lst | $(spcr) | $(sort) > all_aspell.srt
	cat all_aspell.srt | uniq > all_aspell.srt.nodups
	cat all_aspell.srt | uniq -d -c > all_aspell.srt.dups
	-diff all_aspell.srt.nodups.old all_aspell.srt.nodups > all_aspell.srt.nodups.diff
	-diff all_aspell.srt.dups.old all_aspell.srt.dups > all_aspell.srt.dups.diff


regtestroll:
	-[ -f all_aspell.srt.nodups ] && mv -f all_aspell.srt.nodups all_aspell.srt.nodups.old
	-[ -f all_aspell.srt.dups ] && mv -f all_aspell.srt.dups all_aspell.srt.dups.old
	-[ -f Malyk.lst ] && mv -f Malyk.lst Malyk.lst.old
	-[ -f ZN.lst ] && mv -f ZN.lst ZN.lst.old
	-[ -f KDE.lst ] && mv -f KDE.lst KDE.lst.old
	-[ -f ukr_lit.lst ] && mv -f ukr_lit.lst ukr_lit.lst.old

text:
	cat src_text/Malyk.txt | $(LIST_CMD) | LC_ALL=uk_UA.UTF-8 sort | LC_ALL=uk_UA.UTF-8 uniq -i > Malyk.lst
	cat src_text/ZN.txt | $(LIST_CMD) | LC_ALL=uk_UA.UTF-8 sort | LC_ALL=uk_UA.UTF-8 uniq -i > ZN.lst
	cat src_text/KDE.po | sed "s/&//g" | sed "s/’/'/g" | sed -r "s/\\[a-z]//g" | $(LIST_CMD) | LC_ALL=uk_UA.UTF-8 sort | LC_ALL=uk_UA.UTF-8 uniq -i > KDE.lst
	cat src_text/ukr_lit.txt | sed "s/’/'/g" | $(LIST_CMD) | LC_ALL=uk_UA.UTF-8 sort | LC_ALL=uk_UA.UTF-8 uniq -i > ukr_lit.lst

text_regtest:	text
	-diff Malyk.lst.old Malyk.lst > Malyk.diff
	-diff ZN.lst.old ZN.lst > ZN.diff
	-diff KDE.lst.old KDE.lst > KDE.diff
	-diff ukr_lit.lst.old ukr_lit.lst > ukr_lit.diff
	

reverse:	all_aspell.srt
	 iconv -f UTF-8 -t KOI8-U all_aspell.srt | LC_ALL=uk_UA.KOI8-U perl -ne 'print scalar reverse $$_;' | LANG=uk_UA.KOI8-U sort | LC_ALL=uk_UA.KOI8-U perl -ne 'print scalar reverse $$_;' | iconv -f KOI8-U -t UTF-8 > all_spell.reverse.lst


clean:
	rm -f $(CLEANFILES)


distclean:
	rm -f $(CLEANFILES) $(DISTCLEANFILES)


.PHONY: all regtest regtestroll clean clean_all all_spell_lst