From 75d4d72a1f5352d1c3520fbaf96911309fc7f96a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 27 Aug 2016 19:12:36 -0400 Subject: index.atom, also: write-atomic --- Makefile | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b144c89..94f7ae8 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,27 @@ -articles = $(filter-out public/index,$(patsubst %.md,%,$(wildcard public/*.md))) +articles = $(sort $(filter-out public/index,$(patsubst %.md,%,$(wildcard public/*.md)))) -.DELETE_ON_ERROR: -.SECONDARY: +all: public/index.html public/index.atom $(addsuffix .html,$(articles)) -all: public/index.html $(addsuffix .html,$(articles)) +public/%.html: public/%.md page page.html.erb util.rb Makefile write-atomic + ./page html $< | ./write-atomic $@ +public/%.atom: public/%.md page page.atom.erb util.rb Makefile write-atomic + ./page atom $< | ./write-atomic $@ +public/index.md : index index.md.erb .var.articles $(addsuffix .md,$(articles)) util.rb Makefile write-atomic + ./index md $(filter %.md,$^) | ./write-atomic $@ +public/index.atom: index index.atom.erb .var.articles $(addsuffix .md,$(articles)) util.rb Makefile write-atomic + ./index atom $(filter %.md,$^) | ./write-atomic $@ -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,$^) > $@ +clean: + rm -f -- public/*.html public/*.atom public/index.md .var* .tmp* -.var.%: FORCE +.var.%: FORCE write-ifchanged @printf '%s' $(call quote.shell,$($*)) | sed 's/^/#/' | ./write-ifchanged $@ -include $(wildcard .var.*) -clean: - rm -f -- public/*.html public/*.atom public/index.md .var* .tmp* - .PHONY: FORCE .PHONY: all clean +.DELETE_ON_ERROR: +.SECONDARY: define nl -- cgit v1.2.3