--- a/Makefile Thu Mar 24 01:26:14 2016 +0200
+++ b/Makefile Thu Mar 24 01:26:30 2016 +0200
@@ -131,12 +131,13 @@
pkgname = gadict
fullpkgname = $(pkgname)-$(vmajor).$(vminor)
-GADICT_FILES := $(wildcard *.gadict)
+# GADICT_FILES := $(wildcard *.gadict)
+GADICT_FILES := gadict_en-ru+ua.gadict
-C5_FILES := $(wildcard *.dict-c5)
-DICT_FILES := $(C5_FILES:.dict-c5=.dict)
-DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz)
-INDEX_FILES := $(C5_FILES:.dict-c5=.index)
+C5_FILES := $(patsubst %.gadict,dist/dictd/%.c5,$(GADICT_FILES))
+DICT_FILES := $(C5_FILES:.c5=.dict)
+DICTDZ_FILES := $(C5_FILES:.c5=.dict.dz)
+INDEX_FILES := $(C5_FILES:.c5=.index)
RST_TMPL_FILE = dist/misc/rst.tmpl
RST_CSS_FILE = www/tmpl/rst.css
@@ -312,17 +313,20 @@
dict: $(DICTDZ_FILES) $(INDEX_FILES)
# --case-sensitive
-%.dict %.index: %.dict-c5
- sed '/^#/d' $< | dictfmt -c5 \
- --headword-separator '; ' --break-headwords \
- --utf8 --allchars \
- -u "`sed -n '\|http://[[:print:]]\+/|{s=^.*\(http://\)=\1=;p;q;}' $<`" \
- -s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`" \
- $*
+# -u "`sed -n '\|http://[[:print:]]\+/|{s=^.*\(http://\)=\1=;p;q;}' $<`"
+# -s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`"
+dist/dictd/%.dict dist/dictd/%.index: dist/dictd/%.c5
+ (cd dist/dictd; dictfmt -c5 --headword-separator '; ' --break-headwords --utf8 --allchars $*) < $<
-%.dict.dz: %.dict
+dist/dictd/%.dict.dz: dist/dictd/%.dict
dictzip -c $< >$@
+dist/dictd/%.c5: %.gadict | dist/dictd
+ python3 gadict.py $< $@
+
+dist/dictd:
+ mkdir -p $@
+
################################################################
# Install/uninstall targets.