summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-03 20:18:45 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-03 20:18:45 -0500
commit5449dca686d7bdbd5f09acd4e9fd8647535acde9 (patch)
tree2e1b459c517974d9f57c0b52924d49e0ba86afca /Makefile
parent877491a97c2ac140003c6416dbd33630148bb860 (diff)
index.yaml partial support
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 8 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 87fd94f..be186c8 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,6 @@ html.src = $(shell find src -type f \( -false $(foreach s,$(html.suffixes), -o -
html.out = $(call patsubst-all,$(addprefix src/%.,$(html.suffixes)),out/%.html,$(html.src))
html.out += $(foreach d,$(sort $(dir $(patsubst src/%,out/%,$(html.src)))),$dindex.html $dindex.atom)
-mydir = $(patsubst %/,%,$(patsubst out/%,%,$(dir $@)))
-
all: $(html.out) out/main.css
.PHONY: all
@@ -43,14 +41,14 @@ out/%.css: src/%.scss
out/%.css: out/%.scss
scss --stdin < $< > $@
-out/index.md : $(bin/index) bin/index.md.erb .var.html.src $(html.src) bin/write-atomic
- bin/index md '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@
-out/%/index.md : $(bin/index) bin/index.md.erb .var.html.src $(html.src) bin/write-atomic
- bin/index md '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@
-out/index.atom : $(bin/index) bin/index.atom.erb .var.html.src $(html.src) bin/write-atomic
- bin/index atom '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@
-out/%/index.atom: $(bin/index) bin/index.atom.erb .var.html.src $(html.src) bin/write-atomic
- bin/index atom '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@
+index.all = $(html.src) $(shell find src -type f -name index.yaml)
+index.filter = $(filter-out %/index.yaml,$(filter $(@D)/% $(patsubst out%,src%,$(@D))/%,$1))
+index.cmd = bin/index $(patsubst .%,%,$(suffix $@)) $(@D) $(call index.filter,$^) | bin/write-atomic $@
+index.dep = $(bin/index) bin/index.$1.erb .var.index.all $(index.all) bin/write-atomic Makefile
+out/index.md : $(call index.dep,md) ; $(index.cmd)
+out/%/index.md : $(call index.dep,md) ; $(index.cmd)
+out/index.atom : $(call index.dep,atom) ; $(index.cmd)
+out/%/index.atom : $(call index.dep,atom) ; $(index.cmd)
serve: serve-8000
serve-%: all