1DOCS = barman-manual.en.pdf barman-manual.en.html
2
3MDS = $(sort $(wildcard ??-*.en.md))
4
5# Detect the pandoc major version (1 or 2)
6PANDOC_VERSION = $(shell pandoc --version | awk -F '[ .]+' '/^pandoc/{print $$2; exit}')
7ifeq ($(PANDOC_VERSION),1)
8	SMART = --smart
9	NOSMART_SUFFIX =
10else
11	SMART =
12	NOSMART_SUFFIX = -smart
13endif
14
15
16all: $(DOCS)
17
18barman-manual.en.pdf: $(MDS) ../images/*.png
19	pandoc -o $@ -s -f markdown$(NOSMART_SUFFIX) --toc $(MDS)
20
21barman-manual.en.html: $(MDS) ../images/*.png
22	pandoc -o $@ -s -f markdown$(NOSMART_SUFFIX) --toc -t html5 $(MDS)
23
24clean:
25	    rm -f $(DOCS)
26
27help:
28	    @echo "Usage:"
29	    @echo "    $$ make"
30
31.PHONY: all clean help
32