diff options
Diffstat (limited to 'docs/Makefile')
-rw-r--r-- | docs/Makefile | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/docs/Makefile b/docs/Makefile index 2a62f18..f340323 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,6 +1,8 @@ TXT=$(wildcard *.txt) +# Expand target section from heading of each page +MAN=$(shell ls *.txt|xargs -n 1 head -n 1|sed "s,\(.*\)(\([0-9]\)),\1.\2,") HTML=$(patsubst %.txt,%.html,$(TXT)) -MAN=$(patsubst %.txt,%.1,$(TXT)) + all: $(HTML) $(MAN) %.html: %.txt @@ -8,8 +10,15 @@ all: $(HTML) $(MAN) @asciidoc -f asciidoc.conf --backend=html5 $< %.1: %.txt - @echo a2x $< - @a2x --format manpage $< + $(call man,$<) + +%.7: %.txt + $(call man,$<) + +define man + @echo a2x $(1) + @a2x --format manpage $(1) +endef clean: - rm -rf $(wildcard *.html) $(wildcard *.1) + rm -rf $(wildcard *.html) $(wildcard *.1) $(wildcard *.7) |