diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 41 |
1 files changed, 37 insertions, 4 deletions
@@ -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 |