Makefile
1 | .PRECIOUS: po/%.po dictionaries/% |
2 | |
3 | all: site |
4 | |
5 | DICOS= |
6 | DOWNLOADS= |
7 | |
8 | include radicals.mk |
9 | include wadoku.mk |
10 | include jmdict.mk |
11 | |
12 | PAGES=blog.scm data.scm documentation.scm e404.scm feeds.scm index.scm mentions.scm |
13 | |
14 | HAUNT_FILES= haunt.scm $(addprefix pages/, $(PAGES)) \ |
15 | tools/i18n.scm tools/theme.scm |
16 | |
17 | WEB_FILES= $(HAUNT_FILES) \ |
18 | $(shell find css) $(shell find images) $(DICOS) $(addsuffix .sha256, $(DICOS)) \ |
19 | dicos/list |
20 | |
21 | DICO_MODULES=modules/nani/trie.scm modules/nani/result.scm modules/nani/jmdict/trie.scm \ |
22 | modules/nani/jmdict/serialize.scm modules/nani/jmdict/xml.scm \ |
23 | modules/nani/jmdict/entities.scm modules/nani/frequency.scm \ |
24 | modules/nani/serialize.scm |
25 | |
26 | LANGS=fr |
27 | MOFILES=$(addprefix po/, $(addsuffix /LC_MESSAGES/nani.mo, $(LANGS))) |
28 | |
29 | site: $(MOFILES) $(WEB_FILES) |
30 | haunt build |
31 | rm -rf public.bak |
32 | mv public public.bak |
33 | mv site public |
34 | touch site |
35 | |
36 | download: |
37 | @rm -f dictionaries/* |
38 | @$(MAKE) $(DOWNLOADS) |
39 | |
40 | po/%/LC_MESSAGES/nani.mo: po/%.po |
41 | @mkdir -p $$(dirname $@) |
42 | msgfmt --output-file=$@ $< |
43 | |
44 | po/%.po: po/nani.pot |
45 | if [ -f $@ ]; then \ |
46 | msgmerge --update $@ $< ;\ |
47 | else \ |
48 | msginit --input=$< --locale=$$(printf $$(basename $@) | sed 's|.po$$||') --output=$@ ;\ |
49 | fi |
50 | |
51 | po/nani.pot: $(HAUNT_FILES) tools/list.scm |
52 | xgettext --keyword=_ --language=scheme --add-comments --sort-output --from-code UTF-8 -o $@ $^ |
53 | |
54 | %.sha256: % |
55 | sha256sum $< | cut -f1 -d' ' > $@ |
56 | |
57 | dicos/list: $(DICOS) tools/list.scm $(MOFILES) |
58 | guile -L modules -L . tools/list.scm $@ $(DICOS) |
59 |