summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-07 00:59:01 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-07 00:59:01 -0500
commit90a45f9729f131569889f52cf792007f23df3949 (patch)
tree3a7297268da2f4fd81749c4e724faaa7a8f0f047 /Makefile
parentadd2ce8c856d99a2f4cc0bbd4f630cc9aeb2ef05 (diff)
tidy
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile93
1 files changed, 3 insertions, 90 deletions
diff --git a/Makefile b/Makefile
index 2307b64..352236b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,91 +1,4 @@
-SHELL = bash -o pipefail
+MAKEFLAGS += -j1
-RUBYLIB := $(realpath .)/lib$(if $(RUBYLIB),:$(RUBYLIB))
-export RUBYLIB
-
-# Usage: $(call patsubst,PATTERN1 PATTERN2...,REPLACEMENT,TEXT)
-#
-# Like $(patsubst), but takes multiple patterns that are all replaced
-# with the same replacement.
-patsubst-all = $(if $1,$(call patsubst-all,$(wordlist 2,$(words $1),$1),$2,$(patsubst $(firstword $1),$2,$3)),$3)
-
-# Which suffixes can we turn in to HTML?
-html.suffixes = md org
-# Find all source files with those suffixes
-html.src = $(shell find src -type f \( -false $(foreach s,$(html.suffixes), -o -name '*.$s' ) \))
-# Translate the source filenames into output filenames
-html.out = $(call patsubst-all,$(addprefix src/%.,$(html.suffixes)),out/%.html,$(html.src))
-html.dirs = $(sort $(patsubst src%,out%, \
- $(patsubst %/,%,$(dir $(html.src))) \
- $(shell find src -name index.yaml -printf '%h\n')))
-html.out += out/index.atom $(addsuffix /index.html,$(html.dirs))
-
-all: $(html.out) out/main.css
-.PHONY: all out/tags
-
-bin/page = bin/page bin/util.rb bin/pandoc.rb
-bin/index = bin/index bin/util.rb bin/pandoc.rb
-
-out/%.html: src/%.md $(bin/page) bin/page.html.erb bin/write-atomic
- @mkdir -p $(@D)
- bin/page html $< | bin/write-atomic $@
-out/%.html: out/%.md $(bin/page) bin/page.html.erb bin/write-atomic
- bin/page html $< | bin/write-atomic $@
-
-out/%.html: src/%.org $(bin/page) bin/page.html.erb bin/write-atomic
- @mkdir -p $(@D)
- bin/page html $< | bin/write-atomic $@
-out/%.html: out/%.org $(bin/page) bin/page.html.erb bin/write-atomic
- bin/page html $< | bin/write-atomic $@
-
-out/%.css: src/%.scss
- @mkdir -p $(@D)
- scss --stdin < $< > $@
-out/%.css: out/%.scss
- scss --stdin < $< > $@
-
-index.all = $(filter-out %/ChangeLog.md %/index.md,$(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)
- @mkdir -p $(@D)
- $(index.cmd)
-out/%/index.md : $(call index.dep,md)
- @mkdir -p $(@D)
- $(index.cmd)
-out/index.atom : $(call index.dep,atom)
- @mkdir -p $(@D)
- $(index.cmd)
-out/%/index.atom : $(call index.dep,atom)
- @mkdir -p $(@D)
- $(index.cmd)
-
-serve: serve-8000
-serve-%: all
- dir=$$(mktemp -d -t) && trap 'fusermount -u "$$dir"; rmdir "$$dir"' EXIT && unionfs -o ro out:src "$$dir" && (cd "$$dir" && python3 -m http.server $*)
-.PHONY: serve serve-%
-
-.var.%: FORCE bin/write-ifchanged
- @printf '%s' $(call quote.shell,$($*)) | sed 's/^/#/' | bin/write-ifchanged $@
--include $(wildcard .var.*)
-
-
-irb:
- irb
-.PHONY: irb
-
-check:
- ./check.rb
-
-.PHONY: FORCE
-.DELETE_ON_ERROR:
-.SECONDARY:
-
-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)')
+%:
+ ./make