Add VOA to frequency list. Fix dependency on freq list.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 09 Nov 2016 12:45:30 +0200
changeset 651 08417d7454ec
parent 650 b13c09aaa9a3
child 652 fa97354a56d3
Add VOA to frequency list. Fix dependency on freq list.
Makefile
--- a/Makefile	Wed Nov 09 12:44:53 2016 +0200
+++ b/Makefile	Wed Nov 09 12:45:30 2016 +0200
@@ -395,8 +395,20 @@
 ################################################################
 # Word frequency statistic.
 
+define FREQLIST_MACRO
+FREQLIST_OPT += -freq:freq:$(1)=$(2)
+FREQLIST_DEP += $(2)
+endef
+FREQLIST_OPT :=
+FREQLIST_DEP :=
+
 # For dictd and anki.
-FREQLIST_OPT := -freq:freq:GSL=wordlist/gsl.freq -freq:freq:AWL=wordlist/awl.freq -freq:freq:NGSL=wordlist/ngsl.freq -freq:freq:NAWL=wordlist/nawl.freq
+$(eval $(call FREQLIST_MACRO,GSL,wordlist/gsl.freq))
+$(eval $(call FREQLIST_MACRO,AWL,wordlist/awl.freq))
+$(eval $(call FREQLIST_MACRO,NGSL,wordlist/ngsl.freq))
+$(eval $(call FREQLIST_MACRO,NAWL,wordlist/nawl.freq))
+FREQLIST_OPT += -freq:var:VOA=dist/wordlist/voa.list
+FREQLIST_DEP += dist/wordlist/voa.list
 
 FREQ_DEP :=
 FREQ_FILTER :=
@@ -447,7 +459,7 @@
 dist/wordlist/ngsl.var: $(NGSL_BASEWORD) | dist/wordlist/
 	cat $(NGSL_BASEWORD) >$@
 
-dist/wordlist/voa.list: gadict_voa.gadict py/gadict_headwords.py | dist/wordlist/
+dist/wordlist/voa.list: gadict_voa.gadict py/gadict_headwords.py $(MAKEFILE_LIST) | dist/wordlist/
 	python3 -B py/gadict_headwords.py gadict_voa.gadict >$@
 
 dist/wordlist/:
@@ -485,7 +497,7 @@
 
 # -B  suppress __pycache__ dir
 
-dist/dictd/gadict_en-ru+uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py $(MAKEFILE_LIST) | dist/dictd/
+dist/dictd/gadict_en-ru+uk.c5: gadict_en-ru+uk.gadict $(FREQLIST_DEP) py/gadict.py py/gadict_c5.py $(MAKEFILE_LIST) | dist/dictd/
 	python3 -B py/gadict_c5.py $(FREQLIST_OPT)  $< $@
 	echo "gadict En-Ru+Uk"> dist/dictd/gadict_en-ru+uk.c5.name
 
@@ -512,10 +524,10 @@
 .PHONY: anki
 anki: $(SRS_ANKI_FILES)
 
-dist/srs/%.apkg: %.gadict %.del py/gadict.py py/gadict_srs_anki.py $(MAKEFILE_LIST) | dist/srs/
+dist/srs/%.apkg: %.gadict %.del py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/srs/
 	PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py $(FREQLIST_OPT) $< $@
 
-dist/srs/%.apkg: %.gadict py/gadict.py py/gadict_srs_anki.py $(MAKEFILE_LIST) | dist/srs/
+dist/srs/%.apkg: %.gadict py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/srs/
 	PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py $(FREQLIST_OPT) $< $@
 
 dist/srs/gadict_en-ru+uk.tab.txt: gadict_en-ru+uk.gadict py/gadict.py py/gadict_srs_tab.py $(MAKEFILE_LIST) | dist/srs/