summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f10f7dfb7d09260e76475a7379bb0c9f5da2f0d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
BOOKS = inclusion
FORMATS = html txt

# Default format in case a book target is called without FORMAT=*
FORMAT = html

all: $(FORMATS)

books: $(BOOKS)

$(FORMATS):
	@make 'FORMAT=$@' books

$(BOOKS):
	@printf '  RENDER %s as %s\n' '$@' '$(FORMAT)'
	@PERL5LIB=scripts scripts/markdownbook.pl '$(FORMAT)' 'policies/$@'
	@[ '$(FORMAT)' = 'html' ] && \
		ln -sf '../../include/main.css' 'policies/$@/main.css' || true

clean:
	@for book in $(BOOKS); do \
		printf '  CLEAN %s\n' "$${book}"; \
		rm -f "policies/$${book}/"*.html; \
		rm -f "policies/$${book}/"*.txt; \
		rm -f "policies/$${book}/"main.css; \
	done