PANDOC:=$(shell \
if pandoc </dev/null 2>/dev/null; then \
echo pandoc; \
+ touch .docs-available; \
else \
echo "Warning: pandoc not installed; can't generate manpages." >&2; \
echo '@echo Skipping: pandoc'; \
+ rm -f .docs-available; \
fi)
BUP_VERSION:=$(shell ../bup version --tag)
BUP_DATE:=$(shell ../bup version --date)
all: man html
-man: $(patsubst %.md,%,$(wildcard *.md))
+man: $(patsubst %.md,%.1,$(wildcard *.md))
-html: $(patsubst %.1.md,%.html,$(wildcard *.md))
+html: $(patsubst %.md,%.html,$(wildcard *.md))
-%: %.md.tmp Makefile
+%.1: %.md.tmp Makefile
$(PANDOC) -s -r markdown -w man -o $@ $<
-%.html: %.1.md.tmp Makefile
+%.html: %.md.tmp Makefile
$(PANDOC) -s -r markdown -w html -o $@ $<
.PRECIOUS: %.md.tmp
mv $@.new $@
clean:
- rm -f *~ .*~ *.[0-9] *.new *.tmp *.html
+ rm -f *~ .*~ *.[0-9] *.new *.tmp *.html .docs-available