From 91052dfc0d9e23b2baf499f6c5aab21b1544a236 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 26 Oct 2013 19:31:49 +0200 Subject: o Adding a man page on internals. --- docs/Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'docs/Makefile') 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) -- cgit v1.2.3