]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - Makefile
Feat: Python 3
[phdru.name/phdru.name.git] / Makefile
index 862279fa93403fcf52dfcc39d2b579ee0f8de67b..9a402a61433761163e71636170883c15c777ba6b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 # This file is a part of phdru.name homepage/blog/news generator scripts.
 
 # __author__ = "Oleg Broytman <phd@phdru.name>"
-# __copyright__ = "Copyright (C) 2006-2017 PhiloSoft Design"
+# __copyright__ = "Copyright (C) 2006-2024 PhiloSoft Design"
 
 
 .SUFFIXES: # Clear the suffix list
 
 
 %.py: %.tmpl
-       umask 022; cheetah compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup $< && compyle $@ && chmod +x $@
+       umask 022; python3 -m Cheetah.CheetahWrapper compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup $< && python3 -m compileall $@ && chmod +x $@
 
-%.html: %.tmpl
-       umask 022; PYTHONPATH=. PYTHONIOENCODING=koi8-r:replace cheetah fill --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup --stdout $< | iconv -c -f utf-8 -t koi8-r >$@
+%.html: %.tmpl phd.py phd_site.py
+       umask 022; PYTHONPATH=. PYTHONIOENCODING=koi8-r:replace python3 -m Cheetah.CheetahWrapper fill --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup $<
 
 
 .PHONY: fast
@@ -30,7 +30,7 @@ phdru.name: blog news
 
 
 .PHONY: blog
-blog: phd_site.py atom_10.py rss_20.py
+blog: phd.py phd_site.py atom_10.py rss_20.py
        ./reindex_blog_ru
        $(MAKE) html
 
@@ -40,7 +40,7 @@ templates = $(shell find ../htdocs/phdru.name -type f -name \*.tmpl -print)
 htmls = $(patsubst %.tmpl,%.html,$(templates))
 
 .PHONY: html
-html: phd_site.py $(htmls) special-templates sitemap
+html: phd.py phd_site.py $(htmls) special-templates sitemap
 
 
 .PHONY: news
@@ -53,7 +53,7 @@ SITEMAP = ../htdocs/phdru.name/sitemap.xml
 .PHONY: sitemap
 sitemap: $(SITEMAP)
 
-$(SITEMAP): $(allfiles)
+$(SITEMAP): $(allfiles) sitemaps/phdru.name-config.xml
        sitemap_gen.py --config=sitemaps/phdru.name-config.xml
 
 
@@ -77,3 +77,7 @@ special-templates: ../htdocs/phdru.name/Russian/Software/instant-messengers/inst
           -e 's/<div class="section" id="ii">/<lj-cut text="Никто не обещал райского сада...">&/' \
           -e '/<hr width="90%">/,$$d' $< | sed '1,2d'; \
          echo '</lj-cut>'; } >$@
+
+.PHONY: clean-html
+clean-html:
+       find ../htdocs/phdru.name/ -type f -name \*.html -delete