Makefile
changeset 794 b6b7f7a3b4dc
parent 789 1a78ecda2555
child 801 04397698b6be
equal deleted inserted replaced
793:7eff4e15dd87 794:b6b7f7a3b4dc
   154 RST_FILES := $(wildcard www/*.rst)
   154 RST_FILES := $(wildcard www/*.rst)
   155 RST_HTML_FILES := $(patsubst www/%.rst,dist/www/%.html,$(RST_FILES))
   155 RST_HTML_FILES := $(patsubst www/%.rst,dist/www/%.html,$(RST_FILES))
   156 
   156 
   157 INDEX_HTML_FILE := dist/www/index.html
   157 INDEX_HTML_FILE := dist/www/index.html
   158 
   158 
       
   159 STAT_MISSING_FILE := dist/misc/MISSING.rst
   159 STAT_RST_FILE := dist/misc/STAT.rst
   160 STAT_RST_FILE := dist/misc/STAT.rst
   160 STAT_HTML_FILE := dist/www/STAT.html
   161 STAT_HTML_FILE := dist/www/STAT.html
   161 
   162 
   162 WWW_HTML_FILES := $(RST_HTML_FILES) $(INDEX_HTML_FILE) $(STAT_HTML_FILE)
   163 WWW_HTML_FILES := $(RST_HTML_FILES) $(INDEX_HTML_FILE) $(STAT_HTML_FILE)
   163 
   164 
   506 	@echo ===== TSL =====
   507 	@echo ===== TSL =====
   507 	python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/tsl.var
   508 	python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/tsl.var
   508 
   509 
   509 .PHONY: missing-stat
   510 .PHONY: missing-stat
   510 missing-stat: dist/wordlist/gadict.list $(FREQ_DEP) $(BUILD_SCRIPTS)
   511 missing-stat: dist/wordlist/gadict.list $(FREQ_DEP) $(BUILD_SCRIPTS)
   511 	@echo ====== Missing words stat =======
   512 	@ { \
   512 	@printf "%4s: %4s / %4s\n" VOA `python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:dist/wordlist/voa.list | wc -l` `wc -l <dist/wordlist/voa.list`
   513 stat() { \
   513 	@printf "%4s: %4s / %4s\n" GSL `python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/gsl.freq | wc -l` `wc -l <wordlist/gsl.freq`
   514   lack=`python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list $$2:$$3 | wc -l`; \
   514 	@printf "%4s: %4s / %4s\n" AWL `python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/awl.freq | wc -l` `wc -l <wordlist/awl.freq`
   515   total=`wc -l <$$3`; \
   515 	@printf "%4s: %4s / %4s\n" NGSL `python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/ngsl.freq | wc -l` `wc -l <wordlist/ngsl.freq`
   516   cover=$$((total - lack)); \
   516 	@printf "%4s: %4s / %4s\n" NAWL `python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +f:wordlist/nawl.freq | wc -l` `wc -l <wordlist/nawl.freq`
   517   printf "   %4s %5s %5s %4s\n" $$1 $$cover $$total $$lack; \
   517 	@printf "%4s: %4s / %4s\n" BSL `python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/bsl.var | wc -l` `wc -l <wordlist/bsl.var`
   518 }; \
   518 	@printf "%4s: %4s / %4s\n" TSL `python3 -B py/gadict_freq.py -b:dist/wordlist/gadict.list +b:wordlist/tsl.var | wc -l` `wc -l <wordlist/tsl.var`
   519 echo "   ==== ===== ===== ===="; \
       
   520 echo "   List Cover Total Lack"; \
       
   521 echo "   ==== ===== ===== ===="; \
       
   522 stat VOA +b dist/wordlist/voa.list; \
       
   523 stat GSL +f wordlist/gsl.freq; \
       
   524 stat AWL +f wordlist/awl.freq; \
       
   525 stat NGSL +f wordlist/ngsl.freq; \
       
   526 stat NAWL +f wordlist/nawl.freq; \
       
   527 stat BSL +b wordlist/bsl.var; \
       
   528 stat TSL +b wordlist/tsl.var; \
       
   529 echo "   ==== ===== ===== ===="; \
       
   530 } $(REDIR)
   519 
   531 
   520 dist/wordlist/%.list: %.gadict py/gadict_headwords.py $(BUILD_SCRIPTS) | dist/wordlist/
   532 dist/wordlist/%.list: %.gadict py/gadict_headwords.py $(BUILD_SCRIPTS) | dist/wordlist/
   521 	python3 -B py/gadict_headwords.py  $< $@
   533 	python3 -B py/gadict_headwords.py  $< $@
   522 
   534 
   523 dist/wordlist/gsl.var: $(GSL_BASEWORD) | dist/wordlist/
   535 dist/wordlist/gsl.var: $(GSL_BASEWORD) | dist/wordlist/
   664 stat: $(STAT_HTML_FILE)
   676 stat: $(STAT_HTML_FILE)
   665 
   677 
   666 $(STAT_HTML_FILE): $(STAT_RST_FILE) $(RST_CSS_FILE) $(RST_TMPL_FILE) | $(dir $(STAT_HTML_FILE))
   678 $(STAT_HTML_FILE): $(STAT_RST_FILE) $(RST_CSS_FILE) $(RST_TMPL_FILE) | $(dir $(STAT_HTML_FILE))
   667 	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  $<  $@
   679 	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  $<  $@
   668 
   680 
   669 $(STAT_RST_FILE): $(GADICT_FILES) $(BUILD_SCRIPTS) | $(dir $(STAT_RST_FILE))
   681 $(STAT_RST_FILE): $(GADICT_FILES) $(STAT_MISSING_FILE) $(BUILD_SCRIPTS) | $(dir $(STAT_RST_FILE))
   670 	{ \
   682 	{ \
   671 echo '==========================='; \
   683 echo '==========================='; \
   672 echo ' gadict project statistics'; \
   684 echo ' gadict project statistics'; \
   673 echo '==========================='; \
   685 echo '==========================='; \
   674 echo; \
   686 echo; \
   675 echo '.. class:: right'; \
   687 echo '.. class:: right'; \
   676 echo; \
   688 echo; \
   677 echo '=================================== ======== ======== ========'; \
   689 echo '==================== ======== ======== ========'; \
   678 echo '        Dictionary                  Articles Meanings Examples'; \
   690 echo '   Dictionary        Articles Meanings Examples'; \
   679 echo '=================================== ======== ======== ========'; \
   691 echo '==================== ======== ======== ========'; \
   680 total=0; \
   692 total=0; \
   681 for dic in $(GADICT_FILES); do \
   693 for dic in $(GADICT_FILES); do \
   682   awk '\
   694   awk '\
   683 BEGIN { art=0; tr=0; ex = 0; };\
   695 BEGIN { art=0; tr=0; ex = 0; };\
   684 /^__$$/{ art += 1 };\
   696 /^__$$/{ art += 1 };\
   685 /^(en|ru|uk)> /{ ex += 1 };\
   697 /^(en|ru|uk)> /{ ex += 1 };\
   686 /^(n|det|pron|adj|v|adv|prep|conj|num|int|phr|phr\.v|contr|abbr|prefix)$$/{ tr += 1 };'\
   698 /^(n|det|pron|adj|v|adv|prep|conj|num|int|phr|phr\.v|contr|abbr|prefix)$$/{ tr += 1 };'\
   687 "END {printf \"%35s %8s %8s %8s\n\", \"$${dic%.gadict}\", art, tr, ex};"\
   699 "END {printf \"%20s %8s %8s %8s\n\", \"$${dic%.gadict}\", art, tr, ex};"\
   688   <$$dic; \
   700   <$$dic; \
   689 done; \
   701 done; \
   690 echo '=================================== ======== ======== ========'; \
   702 echo '==================== ======== ======== ========'; \
       
   703 echo; \
       
   704 echo '.. table:: ``gadict`` coverage of famous word lists'; \
       
   705 echo '   :class: right'; \
       
   706 echo; \
       
   707 cat  $(STAT_MISSING_FILE); \
   691 } >$@
   708 } >$@
       
   709 
       
   710 $(STAT_MISSING_FILE): REDIR := >$(STAT_MISSING_FILE)
       
   711 $(STAT_MISSING_FILE): missing-stat | $(dir $(STAT_MISSING_FILE))
   692 
   712 
   693 dist/misc/:
   713 dist/misc/:
   694 	mkdir -p $@
   714 	mkdir -p $@
   695 
   715 
   696 ################################################################
   716 ################################################################