summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2010-07-03 02:01:46 +0100
committerNick White <git@njw.me.uk>2010-07-03 02:01:46 +0100
commitb531d55239e3c7d257eae3815123354ef089aef3 (patch)
treea27201eddc2b52ddc3fa5b08ec1d2f7a6237f6a5 /Makefile
parente210cd7dffbe9444be5fcf049c793e8bfbf884b7 (diff)
downloadnjw-website-b531d55239e3c7d257eae3815123354ef089aef3.tar.bz2
njw-website-b531d55239e3c7d257eae3815123354ef089aef3.zip
Switch to HTML5, and GPL throughout
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 20 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index f176449..96e3d8e 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
SITENAME=http://njw.me.uk
FOAF=http://njw.me.uk/card\#i
MD=smu
+MDTEX=/home/nick/src/misc/smu/smu
RSS=index.ttl
BIB=pubs/index.ttl
@@ -10,27 +11,27 @@ BIBTXT=pubs/index.txt
PAGES=$(shell find . -name '*.txt' ! -name 'robots.txt' ! -name $(RSS)) $(BIBTXT)
PUBS=$(shell find ./pubs/ -name '*.txt' ! -name 'index.*')
EXTRAS=$(shell find . -name '*.css') card.ttl
-TARGETS=$(PAGES:.txt=.xml) $(RSS) $(BIBTXT)
+TARGETS=$(PAGES:.txt=.html) $(RSS) $(BIBTXT)
GZIP=$(PAGES:=.gz) $(TARGETS:=.gz) $(EXTRAS:=.gz) $(BIB:=.gz)
all: $(TARGETS) $(GZIP)
$(TARGETS): includes/header.xml includes/footer.xml
+$(PUBS:.txt=.tex): includes/header.tex includes/footer.tex
-$(RSS): $(PAGES)
- echo making $@
- sh makerss.sh $(SITENAME) $(FOAF) $* > $@
-
-pubs/index.txt: $(BIB)
- echo making $@
- sh bibtotxt.sh $< > $@
-
-.txt.xml:
+.txt.html:
echo making $@
sed "s/TITLE/`head -n 1 < $<`/" < includes/header.xml > $@
$(MD) $< >> $@
sed "s/MODDATE/`ls -lc --time-style=+%Y-%m-%d $<|awk '{print $$6}'`/" < includes/footer.xml >> $@
+# TODO: clean up sed here
+.txt.tex:
+ echo making $@
+ sed -e "s/TITLE/`head -n 1 < $<`/" -e "s/AUTHOR/`head -n 4 < $< |tail -n 1|sed 's/#//g'`/" -e "s/DATE/`head -n 5 < $< |tail -n 1|sed 's/#//g'`/" < includes/header.tex > $@
+ $(MDTEX) $< >> $@
+ cat includes/footer.tex >> $@
+
.tex.pdf:
echo making $@
pdflatex -output-directory $(shell dirname $<) $*.tex
@@ -41,8 +42,16 @@ pubs/index.txt: $(BIB)
echo compressing $<
gzip < $< > $@
+$(RSS): $(PAGES)
+ echo making $@
+ sh makerss.sh $(SITENAME) $(FOAF) $* > $@
+
+pubs/index.txt: $(BIB)
+ echo making $@
+ sh bibtotxt.sh $< > $@
+
clean:
rm -f -- $(TARGETS) $(GZIP)
-.SUFFIXES: .txt .xml .rdf .pdf .tex .gz
+.SUFFIXES: .txt .xml .html .rdf .pdf .tex .gz
.SILENT: