]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - Makefile
Fix(phd.py): Change URL for Lurk
[phdru.name/phdru.name.git] / Makefile
index 4bce2f45f377c1c5a62faf6871564f6cecdd6e51..506436311a8e6ee7bc6640afbc953358f6a0bd3d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,79 @@
-%.html: %.tmpl
-       (umask 022; PYTHONPATH=.; export PYTHONPATH; cheetah fill --nobackup $<)
+# Makefile.
+#
+# 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"
+
+
+.SUFFIXES: # Clear the suffix list
+.SUFFIXES: .py .tmpl .html
+
+
+%.py: %.tmpl
+       umask 022; python2.7 `which cheetah` compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup $< && compyle $@ && chmod +x $@
+
+%.html: %.tmpl phd_site.py
+       umask 022; PYTHONPATH=. PYTHONIOENCODING=koi8-r:replace python2.7 `which cheetah` fill --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup --stdout $< | iconv -c -f utf-8 -t koi8-r >$@
+
+
+.PHONY: fast
+fast: news html
+
+
+.PHONY: all
+all: phdru.name
+
+
+.PHONY: phdru.name
+phdru.name: blog news
 
-.PHONY: phd.pp.ru
-phd.pp.ru: blog html
 
 .PHONY: blog
-blog:
+blog: phd_site.py atom_10.py rss_20.py
        ./reindex_blog_ru
+       $(MAKE) html
 
-templates = $(shell find ../htdocs/phd.pp.ru -type f -name \*.tmpl -print)
+
+allfiles = $(shell find ../htdocs/phdru.name -type f ! -name sitemap.xml -print)
+templates = $(shell find ../htdocs/phdru.name -type f -name \*.tmpl -print)
 htmls = $(patsubst %.tmpl,%.html,$(templates))
 
 .PHONY: html
-html: $(htmls)
+html: phd_site.py $(htmls) special-templates sitemap
+
+
+.PHONY: news
+news: atom_10.py rss_20.py
+       (umask 022; PYTHONPATH=. ./make-news.py en ../htdocs/phdru.name && ./make-news.py ru ../htdocs/phdru.name/Russian)
+
+
+SITEMAP = ../htdocs/phdru.name/sitemap.xml
+
+.PHONY: sitemap
+sitemap: $(SITEMAP)
+
+$(SITEMAP): $(allfiles) sitemaps/phdru.name-config.xml
+       sitemap_gen.py --config=sitemaps/phdru.name-config.xml
+
+
+.PHONY: special-templates
+special-templates: ../htdocs/phdru.name/Russian/Software/instant-messengers/instant-messengers-lj.html ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio-lj.html ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio2-lj.html
+
+../htdocs/phdru.name/Russian/Software/instant-messengers/instant-messengers-lj.html: ../htdocs/phdru.name/Russian/Software/instant-messengers/instant-messengers.html
+       { sed -e '1,/alink="#ff0000">/d' \
+          -e 's/<div class="section" id="icq">/<lj-cut text="IM">&/' \
+          -e '/<hr width="90%">/,$$d' $< | sed '1,2d'; \
+         echo '</lj-cut>'; } >$@
+
+../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio-lj.html: ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio.html
+       { sed -e '1,/alink="#ff0000">/d' \
+          -e 's/<div class="section" id="i">/<lj-cut text="АвтоБио...">&/' \
+          -e '/<hr width="90%">/,$$d' $< | sed '1,2d'; \
+         echo '</lj-cut>'; } >$@
+
+../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio2-lj.html: ../htdocs/phdru.name/Russian/remote-work-bio/remote-work-bio2.html
+       { sed -e '1,/alink="#ff0000">/d' \
+          -e 's/<div class="section" id="ii">/<lj-cut text="Никто не обещал райского сада...">&/' \
+          -e '/<hr width="90%">/,$$d' $< | sed '1,2d'; \
+         echo '</lj-cut>'; } >$@