Makefile
changeset 424 98c8f14fc972
parent 410 65b38ec04ea4
child 427 cc2a83d4d2f8
equal deleted inserted replaced
423:6a772e1fc63d 424:98c8f14fc972
   131 pkgname = gadict
   131 pkgname = gadict
   132 fullpkgname = $(pkgname)-$(vmajor).$(vminor)
   132 fullpkgname = $(pkgname)-$(vmajor).$(vminor)
   133 
   133 
   134 PY_FILES := $(wildcard py/gadict*.py)
   134 PY_FILES := $(wildcard py/gadict*.py)
   135 
   135 
   136 # GADICT_FILES := $(wildcard *.gadict)
   136 GADICT_FILES := $(wildcard *.gadict)
   137 GADICT_FILES := gadict_en-ru+uk.gadict
       
   138 
   137 
   139 C5_FILES := dist/dictd/gadict_en-ru+uk.c5 dist/dictd/gadict_voa.c5
   138 C5_FILES := dist/dictd/gadict_en-ru+uk.c5 dist/dictd/gadict_voa.c5
   140 ALL_C5_FILES := $(C5_FILES) dist/dictd/gadict_en-ru.c5 dist/dictd/gadict_en-uk.c5
   139 ALL_C5_FILES := $(C5_FILES) dist/dictd/gadict_en-ru.c5 dist/dictd/gadict_en-uk.c5
   141 DICT_FILES := $(C5_FILES:.c5=.dict)
   140 DICT_FILES := $(C5_FILES:.c5=.dict)
   142 DICTDZ_FILES := $(C5_FILES:.c5=.dict.dz)
   141 DICTDZ_FILES := $(C5_FILES:.c5=.dict.dz)
   325 
   324 
   326 dist/dictd/%.c5.name dist/dictd/%.c5.url: dist/dictd/%.c5
   325 dist/dictd/%.c5.name dist/dictd/%.c5.url: dist/dictd/%.c5
   327 	:
   326 	:
   328 
   327 
   329 # -B  suppress __pycache__ dir
   328 # -B  suppress __pycache__ dir
   330 dist/dictd/gadict_en-ru+uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd
   329 dist/dictd/gadict_en-ru+uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
   331 	python3 -B py/gadict_c5.py  $< $@
   330 	python3 -B py/gadict_c5.py  $< $@
   332 
   331 
   333 dist/dictd/gadict_en-ru.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd
   332 dist/dictd/gadict_en-ru.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
   334 	python3 -B py/gadict_c5.py  $< $@ ru
   333 	python3 -B py/gadict_c5.py  $< $@ ru
   335 	echo "gadict En-Ru"> dist/dictd/gadict_en-ru.c5.name
   334 	echo "gadict En-Ru"> dist/dictd/gadict_en-ru.c5.name
   336 
   335 
   337 dist/dictd/gadict_en-uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd
   336 dist/dictd/gadict_en-uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
   338 	python3 -B py/gadict_c5.py  $< $@ uk
   337 	python3 -B py/gadict_c5.py  $< $@ uk
   339 	echo "gadict En-Uk"> dist/dictd/gadict_en-uk.c5.name
   338 	echo "gadict En-Uk"> dist/dictd/gadict_en-uk.c5.name
   340 
   339 
   341 dist/dictd/gadict_voa.c5: gadict_voa.gadict py/gadict.py py/gadict_c5.py | dist/dictd
   340 dist/dictd/gadict_voa.c5: gadict_voa.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
   342 	python3 -B py/gadict_c5.py  $< $@ en
   341 	python3 -B py/gadict_c5.py  $< $@ en
   343 
   342 
   344 dist/dictd:
   343 dist/dictd/:
   345 	mkdir -p $@
   344 	mkdir -p $@
   346 
   345 
   347 ################################################################
   346 ################################################################
   348 # Install/uninstall targets.
   347 # Install/uninstall targets.
   349 
   348 
   386 html: $(RST_HTML_FILES)
   385 html: $(RST_HTML_FILES)
   387 
   386 
   388 $(INDEX_HTML_FILE): dist/www/README.html
   387 $(INDEX_HTML_FILE): dist/www/README.html
   389 	cp $< $@
   388 	cp $< $@
   390 
   389 
   391 $(RST_HTML_FILES): dist/www/%.html: www/%.rst $(RST_CSS_FILE) $(RST_TMPL_FILE) $(BUILD_SCRIPTS) | dist/www
   390 $(RST_HTML_FILES): dist/www/%.html: www/%.rst $(RST_CSS_FILE) $(RST_TMPL_FILE) $(BUILD_SCRIPTS) | dist/www/
   392 	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  www/$*.rst  $@
   391 	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  www/$*.rst  $@
   393 
   392 
   394 dist/www:
   393 dist/www/:
   395 	mkdir -p $@
   394 	mkdir -p $@
   396 
   395 
   397 $(RST_TMPL_FILE): www/tmpl/rst.tmpl.in $(BUILD_SCRIPTS) | $(dir $(RST_TMPL_FILE))
   396 $(RST_TMPL_FILE): www/tmpl/rst.tmpl.in $(BUILD_SCRIPTS) | $(dir $(RST_TMPL_FILE))
   398 	\
   397 	\
   399 [[ ${visclean} = no ]] && warn1='<b>Warning</b>: Build done with local changes!' || :; \
   398 [[ ${visclean} = no ]] && warn1='<b>Warning</b>: Build done with local changes!' || :; \
   407 stat: $(STAT_HTML_FILE)
   406 stat: $(STAT_HTML_FILE)
   408 
   407 
   409 $(STAT_HTML_FILE): $(STAT_RST_FILE) $(RST_CSS_FILE) $(RST_TMPL_FILE) | dist/www
   408 $(STAT_HTML_FILE): $(STAT_RST_FILE) $(RST_CSS_FILE) $(RST_TMPL_FILE) | dist/www
   410 	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  $<  $@
   409 	$(RST2HTML) $(RST2HTML_FLAGS) --stylesheet=$(RST_CSS_FILE) --template=$(RST_TMPL_FILE)  $<  $@
   411 
   410 
   412 $(STAT_RST_FILE): $(GADICT_FILES) $(BUILD_SCRIPTS)
   411 $(STAT_RST_FILE): $(GADICT_FILES) $(BUILD_SCRIPTS) | $(dir $(STAT_RST_FILE))
   413 	{ \
   412 	{ \
   414 echo '==========================='; \
   413 echo '==========================='; \
   415 echo ' gadict project statistics'; \
   414 echo ' gadict project statistics'; \
   416 echo '==========================='; \
   415 echo '==========================='; \
   417 echo '.. contents::'; \
   416 echo '.. contents::'; \
   418 echo '   :local:'; \
   417 echo '   :local:'; \
   419 echo; \
   418 echo; \
   420 echo '======================================== ====='; \
   419 echo '======================================== ======='; \
   421 echo '             Dictionary                  Count'; \
   420 echo '             Dictionary                  Entries'; \
   422 echo '======================================== ====='; \
   421 echo '======================================== ======='; \
   423 total=0; \
   422 total=0; \
   424 for dic in $(GADICT_FILES); do \
   423 for dic in $(GADICT_FILES); do \
   425   cnt=`grep '^__' $$dic | wc -l`; \
   424   cnt=`grep '^__' $$dic | wc -l`; \
   426   printf '%40s %5s\n' $${dic%.dict-c5} $$cnt; \
   425   printf '%40s %7s\n' $${dic%.dict-c5} $$cnt; \
   427   total=$$(($$total + $$cnt)); \
   426   total=$$(($$total + $$cnt)); \
   428 done; \
   427 done; \
   429 printf '%40s %5s\n' '**Total**' $$total; \
   428 printf '%40s %7s\n' '**Total**' $$total; \
   430 echo '======================================== ====='; \
   429 echo '======================================== ======='; \
   431 } >$@
   430 } >$@
       
   431 
       
   432 dist/misc/:
       
   433 	mkdir -p $@
   432 
   434 
   433 ################################################################
   435 ################################################################
   434 # Misc targets.
   436 # Misc targets.
   435 
   437 
   436 .PHONY: logo
   438 .PHONY: logo