jaynes-intel-voice/Makefile

22 lines
574 B
Makefile

DEST=book.txt
chapters=$(wildcard chapters/*.txt)
all: $(DEST)
$(DEST): $(chapters) _preface.txt _version.txt _toc.txt _conclusion.txt _authors.txt
cat _version.txt _preface.txt _toc.txt $(chapters) _conclusion.txt _authors.txt > "$(DEST)"
.PHONY: _version.txt
_version.txt:
echo -n "Book version: " > _version.txt
date +"%Y-%m-%d" >> _version.txt
echo >> _version.txt
.PHONY: _toc.txt
_toc.txt:
echo "=== Table of Contents ===\n" > _toc.txt
for f in chapters/*.txt; do head -n 1 "$$f" >> _toc.txt; done
echo "\n=== End of Table of Contents ===\n" >> _toc.txt