From 7eea1f2b86f532dd3e9e87ae192ed53d42a05ce7 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 13 Aug 2012 18:20:42 -0400 Subject: Add markdownbook stuff to Makefile. --- diff --git a/Makefile b/Makefile index f075102..0eae244 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,24 @@ +# Copyright (C) 2012 Patrick "P. J." McDermott +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + .SUFFIXES: .SUFFIXES: .txt .html @@ -6,8 +27,15 @@ SRCS = specs/source-package-format-1.0.txt \ specs/source-package-format-2.0.txt OBJS = $(SRCS:.txt=.html) -.PHONY: all -all: $(OBJS) +BOOKS = +FORMATS = html txt + +# Default format in case a book target is called without FORMAT=* +FORMAT = html + +all: $(OBJS) $(BOOKS) + +books: $(BOOKS) $(OBJS): @printf ' RENDER %s\n' '$@' @@ -17,9 +45,14 @@ $(OBJS): @markdown $*.txt >> $@ @cat include/footer.html >> $@ -.PHONY: clean clean: @for obj in $(OBJS); do \ - printf ' RM %s\n' "$${obj}"; \ + printf ' CLEAN %s\n' "$${obj}"; \ rm -f $${obj}; \ done + @for book in $(BOOKS); do \ + printf ' CLEAN %s\n' "$${book}"; \ + rm -f "specs/$${book}/"*.html; \ + rm -f "specs/$${book}/"*.txt; \ + rm -f "specs/$${book}/"main.css; \ + done -- cgit v0.9.1