summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-03-08 22:17:21 (EST)
committer P. J. McDermott <pjm@nac.net>2012-03-08 22:17:21 (EST)
commitd54f4504c51f90833e06288623074413faaa645b (patch)
tree15905c0fd79492945040dc9cc5ab44bc0753201a /Makefile
parentae80d85bc0acc9c19e9a8586d517d823257dfe69 (diff)
Add a makefile.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bfd4cb5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
+.SUFFIXES:
+.SUFFIXES: .txt .html
+
+SRCS = specs/source-package-format-1.0.txt
+OBJS = $(SRCS:.txt=.html)
+
+.PHONY: all
+all: $(OBJS)
+
+$(OBJS):
+ @printf ' RENDER %s\n' '$@'
+ @title=$$(sed -n 's/^ Title: \(.*\)$$/\1/p' $*.txt | \
+ head -n 1); \
+ sed "s#@TITLE@#$$title#" include/header.html > $@
+ @markdown $*.txt >> $@
+ @cat include/footer.html >> $@
+
+.PHONY: clean
+clean:
+ @for obj in $(OBJS); do \
+ printf ' RM %s\n' "$${obj}"; \
+ rm -f $${obj}; \
+ done