update makefiles
Makefile
2 | 2 | ||
3 | 3 | JMDICT_LANGS=dut fre ger hun rus slv spa swe | |
4 | 4 | ||
5 | - | DICOS=dicos/JMdict_e.nani $(addprefix dicos/JMdict_, $(addsuffix .nani, $(JMDICT_LANGS))) dicos/radicals.nani | |
5 | + | DICOS=dicos/JMdict_e.nani $(addprefix dicos/JMdict_, $(addsuffix .nani, $(JMDICT_LANGS))) | |
6 | 6 | ||
7 | 7 | PAGES=blog.scm data.scm documentation.scm e404.scm feeds.scm index.scm mentions.scm | |
8 | 8 | ||
… | |||
11 | 11 | ||
12 | 12 | WEB_FILES= $(HAUNT_FILES) \ | |
13 | 13 | $(shell find css) $(shell find images) $(DICOS) $(addsuffix .sha256, $(DICOS)) \ | |
14 | + | dicos/list | |
14 | 15 | ||
15 | 16 | DICO_MODULES=modules/nani/trie.scm modules/nani/result.scm modules/nani/jmdict/trie.scm \ | |
16 | 17 | modules/nani/jmdict/serialize.scm modules/nani/jmdict/xml.scm \ | |
… | |||
18 | 19 | modules/nani/serialize.scm | |
19 | 20 | ||
20 | 21 | LANGS=fr | |
22 | + | MOFILES=$(addprefix po/, $(addsuffix /LC_MESSAGES/nani.mo, $(LANGS))) | |
21 | 23 | ||
22 | - | all: $(addprefix po/, $(addsuffix /LC_MESSAGES/nani.mo, $(LANGS))) $(WEB_FILES) | |
24 | + | all: $(MOFILES) $(WEB_FILES) | |
23 | 25 | haunt build | |
24 | 26 | rm -rf public.bak | |
25 | 27 | mv public public.bak | |
… | |||
28 | 30 | ||
29 | 31 | download: | |
30 | 32 | @rm -f dictionaries/* | |
31 | - | @$(MAKE) dictionaries/JMdict_e.xml dictionaries/JMdict.xml dictionaries/frequency.tsv | |
33 | + | @$(MAKE) dictionaries/JMdict_e.xml dictionaries/JMdict.xml dictionaries/frequency.tsv dictionaries/wadoku.xml dictionaries/radkfilex.utf8 | |
32 | 34 | ||
33 | 35 | # Download JMdict dictionaries from ERDRG | |
34 | 36 | dictionaries/%.xml: | |
… | |||
51 | 53 | dictionaries/%.sxml: dictionaries/%.xml tools/jmdict.scm | |
52 | 54 | guile -L modules tools/jmdict.scm convert $< nolang $@ | |
53 | 55 | ||
54 | - | dicos/JMdict_%.nani: dictionaries/JMdict.sxml tools/jmdict.scm dictionaries/frequency.tsv $(DICO_MODULES) | |
56 | + | dicos/JMdict_%.nani: dictionaries/JMdict.xml tools/jmdict.scm dictionaries/frequency.tsv $(DICO_MODULES) | |
55 | 57 | guile -L modules tools/jmdict.scm build \ | |
56 | 58 | $< $(shell echo $@ | sed 's|^.*_\([^.]*\)\..*$$|\1|g') $@ | |
57 | 59 | ||
58 | - | dicos/JMdict_e.nani: dictionaries/JMdict_e.sxml tools/jmdict.scm dictionaries/frequency.tsv $(DICO_MODULES) | |
60 | + | dicos/JMdict_e.nani: dictionaries/JMdict_e.xml tools/jmdict.scm dictionaries/frequency.tsv $(DICO_MODULES) | |
59 | 61 | guile -L modules tools/jmdict.scm build $< e $@ | |
60 | 62 | ||
61 | 63 | po/%/LC_MESSAGES/nani.mo: po/%.po | |
… | |||
69 | 71 | msginit --input=$< --locale=$$(printf $$(basename $@) | sed 's|.po$$||') --output=$@ ;\ | |
70 | 72 | fi | |
71 | 73 | ||
72 | - | po/nani.pot: $(HAUNT_FILES) | |
74 | + | po/nani.pot: $(HAUNT_FILES) tools/list.scm | |
73 | 75 | xgettext --keyword=_ --language=scheme --add-comments --sort-output --from-code UTF-8 -o $@ $^ | |
74 | 76 | ||
75 | 77 | %.sha256: % | |
76 | 78 | sha256sum $< | cut -f1 -d' ' > $@ | |
77 | 79 | ||
80 | + | dicos/list: $(DICOS) tools/list.scm $(MOFILES) | |
81 | + | guile -L modules -L . tools/list.scm $@ $(DICOS) | |
82 | + | ||
78 | 83 | include radicals.mk | |
84 | + | include wadoku.mk |
radicals.mk
1 | 1 | RADK_MODULES=tools/radk.scm modules/nani/radk.scm modules/nani/serialize.scm | |
2 | + | DICOS+=dicos/radicals.nani | |
2 | 3 | ||
3 | 4 | dictionaries/kradzip.zip: | |
4 | 5 | wget ftp://ftp.monash.edu/pub/nihongo/kradzip.zip -O $@ |
wadoku.mk unknown status 1
1 | + | WADOKU_TMP_DIR=dictionaries/wadoku-tmp | |
2 | + | DICOS+=dicos/wadoku_ger.nani | |
3 | + | ||
4 | + | dictionaries/wadoku.xml: | |
5 | + | mkdir $(WADOKU_TMP_DIR) | |
6 | + | wget https://www.wadoku.de/downloads/xml-export/ -O $(WADOKU_TMP_DIR)/index.html | |
7 | + | file=$$(grep href $(WADOKU_TMP_DIR)/index.html | cut -f2 --delimiter='"' | \ | |
8 | + | grep ^wadoku-xml | grep xz$$ | tail -1); \ | |
9 | + | wget https://www.wadoku.de/downloads/xml-export/$$file -O \ | |
10 | + | $(WADOKU_TMP_DIR)/wadoku.tar.xz | |
11 | + | (cd $(WADOKU_TMP_DIR); tar xf wadoku.tar.xz) | |
12 | + | cp $(WADOKU_TMP_DIR)/wadoku-xml*/wadoku.xml $@ | |
13 | + | rm -rf $(WADOKU_TMP_DIR) | |
14 | + | ||
15 | + | dicos/wadoku_ger.nani: dictionaries/wadoku-test.xml tools/wadoku.scm dictionaries/frequency.tsv $(DICO_MODULES) | |
16 | + | guile -L modules tools/wadoku.scm build \ | |
17 | + | $< $(shell echo $@ | sed 's|^.*_\([^.]*\)\..*$$|\1|g') $@ |