Fix "stat" target.
--- a/Makefile Fri Apr 01 22:38:07 2016 +0300
+++ b/Makefile Fri Apr 01 23:28:53 2016 +0300
@@ -133,8 +133,7 @@
PY_FILES := $(wildcard py/gadict*.py)
-# GADICT_FILES := $(wildcard *.gadict)
-GADICT_FILES := gadict_en-ru+uk.gadict
+GADICT_FILES := $(wildcard *.gadict)
C5_FILES := dist/dictd/gadict_en-ru+uk.c5 dist/dictd/gadict_voa.c5
ALL_C5_FILES := $(C5_FILES) dist/dictd/gadict_en-ru.c5 dist/dictd/gadict_en-uk.c5
@@ -327,21 +326,21 @@
:
# -B suppress __pycache__ dir
-dist/dictd/gadict_en-ru+uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd
+dist/dictd/gadict_en-ru+uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
python3 -B py/gadict_c5.py $< $@
-dist/dictd/gadict_en-ru.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd
+dist/dictd/gadict_en-ru.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
python3 -B py/gadict_c5.py $< $@ ru
echo "gadict En-Ru"> dist/dictd/gadict_en-ru.c5.name
-dist/dictd/gadict_en-uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd
+dist/dictd/gadict_en-uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
python3 -B py/gadict_c5.py $< $@ uk
echo "gadict En-Uk"> dist/dictd/gadict_en-uk.c5.name
-dist/dictd/gadict_voa.c5: gadict_voa.gadict py/gadict.py py/gadict_c5.py | dist/dictd
+dist/dictd/gadict_voa.c5: gadict_voa.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
python3 -B py/gadict_c5.py $< $@ en
-dist/dictd:
+dist/dictd/:
mkdir -p $@
################################################################
@@ -388,10 +387,10 @@
$(INDEX_HTML_FILE): dist/www/README.html
cp $< $@
-$(RST_HTML_FILES): dist/www/%.html: www/%.rst $(RST_CSS_FILE) $(RST_TMPL_FILE) $(BUILD_SCRIPTS) | dist/www
+$(RST_HTML_FILES): dist/www/%.html: www/%.rst $(RST_CSS_FILE) $(RST_TMPL_FILE) $(BUILD_SCRIPTS) | dist/www/
$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE) www/$*.rst $@
-dist/www:
+dist/www/:
mkdir -p $@
$(RST_TMPL_FILE): www/tmpl/rst.tmpl.in $(BUILD_SCRIPTS) | $(dir $(RST_TMPL_FILE))
@@ -409,7 +408,7 @@
$(STAT_HTML_FILE): $(STAT_RST_FILE) $(RST_CSS_FILE) $(RST_TMPL_FILE) | dist/www
$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE) $< $@
-$(STAT_RST_FILE): $(GADICT_FILES) $(BUILD_SCRIPTS)
+$(STAT_RST_FILE): $(GADICT_FILES) $(BUILD_SCRIPTS) | $(dir $(STAT_RST_FILE))
{ \
echo '==========================='; \
echo ' gadict project statistics'; \
@@ -417,19 +416,22 @@
echo '.. contents::'; \
echo ' :local:'; \
echo; \
-echo '======================================== ====='; \
-echo ' Dictionary Count'; \
-echo '======================================== ====='; \
+echo '======================================== ======='; \
+echo ' Dictionary Entries'; \
+echo '======================================== ======='; \
total=0; \
for dic in $(GADICT_FILES); do \
cnt=`grep '^__' $$dic | wc -l`; \
- printf '%40s %5s\n' $${dic%.dict-c5} $$cnt; \
+ printf '%40s %7s\n' $${dic%.dict-c5} $$cnt; \
total=$$(($$total + $$cnt)); \
done; \
-printf '%40s %5s\n' '**Total**' $$total; \
-echo '======================================== ====='; \
+printf '%40s %7s\n' '**Total**' $$total; \
+echo '======================================== ======='; \
} >$@
+dist/misc/:
+ mkdir -p $@
+
################################################################
# Misc targets.