summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-08-27 17:36:46 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-08-27 17:36:46 -0400
commitb373a3a6e1702e7514bb405122a2311d16d85fcd (patch)
tree1b8ededef1b8ac60ec3b1a8a347cfc1669f61bb1 /Makefile
parentd4359dc767d3524a16f529f3545d89ab558e1b8f (diff)
Teach it to make atom:entry files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 23 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index de1cfa9..b144c89 100644
--- a/Makefile
+++ b/Makefile
@@ -5,11 +5,27 @@ articles = $(filter-out public/index,$(patsubst %.md,%,$(wildcard public/*.md)))
all: public/index.html $(addsuffix .html,$(articles))
-public/%.html: public/%.md pagerender.rb template.erb Makefile
- ./pagerender.rb $< > $@
-public/index.md: public/ $(addsuffix .md,$(articles)) index.rb Makefile
- ./index.rb $(filter-out public/ index.rb Makefile $@,$^) > $@
- touch public/
- touch $@
+public/%.html: public/%.md pagerender.rb template.html.erb util.rb Makefile
+ ./pagerender.rb html $< > $@
+public/%.atom: public/%.md pagerender.rb template.atom.erb util.rb Makefile
+ ./pagerender.rb atom $< > $@
+public/index.md: .var.articles $(addsuffix .md,$(articles)) index.rb Makefile
+ ./index.rb $(filter %.md,$^) > $@
+
+.var.%: FORCE
+ @printf '%s' $(call quote.shell,$($*)) | sed 's/^/#/' | ./write-ifchanged $@
+-include $(wildcard .var.*)
+
clean:
- rm -f -- public/*.html public/index.md
+ rm -f -- public/*.html public/*.atom public/index.md .var* .tmp*
+
+.PHONY: FORCE
+.PHONY: all clean
+
+define nl
+
+
+endef
+# I put this as the last line in the file because it confuses Emacs syntax
+# highlighting and makes the remainder of the file difficult to edit.
+quote.shell = $(subst $(nl),'$$'\n'','$(subst ','\'',$1)')