summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-08-12 15:31:17 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-08-12 15:31:17 (EDT)
commitc35bb407534901f283787c9458c24c9ac6810858 (patch)
tree986d2f8fd3ed90d5b72337e920ceecdd2122f047
parentb2b307a2b170755a7218703cb4f761f58270a973 (diff)
Update build system.
-rw-r--r--Makefile34
1 files changed, 17 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 0707f0b..5d102ae 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,23 @@
-.SUFFIXES:
-.SUFFIXES: .txt .html
+BOOKS = inclusion
+FORMATS = html txt
-SRCS =
-OBJS = $(SRCS:.txt=.html)
+# Default format in case a book target is called without FORMAT=*
+FORMAT = html
-.PHONY: all
-all: $(OBJS)
+all: $(FORMATS)
-$(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 >> $@
+books: $(BOOKS)
+
+$(FORMATS):
+ @make 'FORMAT=$@' books
+
+$(BOOKS):
+ @printf ' RENDER %s as %s\n' '$@' '$(FORMAT)'
+ @PERL5LIB=scripts scripts/markdownbook.pl $(FORMAT) 'policies/$@'
-.PHONY: clean
clean:
- @for obj in $(OBJS); do \
- printf ' RM %s\n' "$${obj}"; \
- rm -f $${obj}; \
+ @for book in $(BOOKS); do \
+ printf ' CLEAN %s\n' "$${book}"; \
+ rm -f "policies/$${book}/"*.html; \
+ rm -f "policies/$${book}/"*.txt; \
done