l2tpns/docs/Makefile
Samuel Thibault 6be06966e3 Use Makefile rules to generate documentation
And regenerate documentation.
2023-12-24 15:42:03 +01:00

29 lines
816 B
Makefile

ifeq (,$(shell command -v pandoc))
all:
clean:
else
# Source documentation in markdown lives in the src/ folder (html and manpages).
# This is what you should edit if you want to make changes to the documentation.
# From these sources, this script generates actual manpages and general
# documentation in html using pandoc.
HTML_MD = $(wildcard src/html/*.md)
MAN_MD = $(wildcard src/man/*.md)
HTML_HTML = $(patsubst src/html/%.md,html/%.html,$(HTML_MD))
MAN_MAN = $(patsubst src/man/%.md,manpages/%,$(MAN_MD))
all: $(HTML_HTML) $(MAN_MAN)
html/%.html: src/html/%.md
pandoc -f markdown -t html $< > $@
echo $@ successfully built in docs/html directory
manpages/%: src/man/%.md
pandoc -s -t man $< -o $@
echo $@ successfully built in docs/manpages directory
clean:
rm -f html/*.html manpages/*.[58]
endif