aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetWeb/publications/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetWeb/publications/Makefile')
-rw-r--r--Carpet/CarpetWeb/publications/Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Carpet/CarpetWeb/publications/Makefile b/Carpet/CarpetWeb/publications/Makefile
new file mode 100644
index 000000000..d385e223f
--- /dev/null
+++ b/Carpet/CarpetWeb/publications/Makefile
@@ -0,0 +1,46 @@
+SECTIONS = background refereed book report thesis webpage
+
+ALLSECTIONS = $(SECTIONS) internal
+
+all: carpet-publications.pdf publications.html
+
+carpet-publications.pdf: carpet-publications.tex carpet-publications.bib $(SECTIONS:%=citations-%.bibitems)
+ rubber -d carpet-publications
+
+publications.html: $(SECTIONS:%=citations-%.html-updated)
+
+.PRECIOUS: $(SECTIONS:%=citations-%.tex)
+citations-%.tex: citations.template
+ sed -e 's/STATUS/$*/g' citations.template > $@
+
+.PRECIOUS: $(SECTIONS:%=citations-%.bib)
+citations-%.bib: carpet-publications.bib
+ bibtool -q -- 'select.by.string{status "$*"}' -- 'sort{on}' -- 'sort.reverse{on}' -- 'sort.format{%N(receiveddate)}' < carpet-publications.bib > $@
+
+# this produces also %.aux and %.bbl
+.PRECIOUS: $(SECTIONS:%=citations-%.pdf)
+citations-%.pdf: citations-%.tex citations-%.bib
+ rubber -d citations-$*
+
+citations-%.bibitems: citations-%.pdf
+ cat citations-$*.bbl | grep -v thebibliography | sed -e 's/bibitem/blurb/' > $@
+
+# http://www.spinellis.gr/sw/textproc/bib2xhtml/
+# Sorted alphabetically:
+# ./bib2xhtml -r -s empty -u $*.aux publications.html
+# ./bib2xhtml -s unsort -u $*.aux publications.html
+# ./bib2xhtml -s unsortlist -u $*.aux publications.html
+citations-%.html-updated: citations-%.pdf
+ ./bib2xhtml -s unsortlist -u citations-$*.aux publications.html
+ : > $@
+
+EMPTY :=
+SPACE := $(EMPTY) $(EMPTY)
+check:
+ bibtool -q -- 'select.non{status "$(subst $(SPACE),\|,$(ALLSECTIONS))"}' < carpet-publications.bib
+
+clean:
+ rubber -d --clean carpet-publications
+ $(RM) $(SECTIONS:%=citations-%.*)
+
+.PHONY: all check clean