aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-03-08 22:19:02 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-03-08 22:19:02 -0500
commit9daa31e0ad4164bf41d8d10cc1630ec3ef9f398c (patch)
treeb6558f0fee210d90eb6da894cc37b6c2ecfb0c26
parentefc0bfac7b966fbf4776f11a7922d6c0d92e7ac8 (diff)
trace-cmd: Add Makefile to build man pages
Add a Makefile that has logic to build a man page. It is still very primitive and uses ascriidoc and xsltproc to do the formating. But instead of build my own xsl file or putting together one from others, I decided to use xsl files that already exist by doing a locate on manpages/docbook.xsl, and using what is found. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--Documentation/.gitignore1
-rw-r--r--Documentation/Makefile29
-rw-r--r--Makefile6
3 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
new file mode 100644
index 0000000..f7e585b
--- /dev/null
+++ b/Documentation/.gitignore
@@ -0,0 +1 @@
*.1
diff --git a/Documentation/Makefile b/Documentation/Makefile
new file mode 100644
index 0000000..87c38ae
--- /dev/null
+++ b/Documentation/Makefile
@@ -0,0 +1,29 @@
1
2#
3# Most likely a docbook.xsl is already installed on the users system
4# instead of creating a new wheel, lets reuse what's already there.
5#
6MANPAGE_DOCBOOK_XSL = $(shell locate manpages/docbook.xsl | head -1)
7
8%.xml: %.txt
9 asciidoc -d manpage -b docbook $<
10
11%.1: %.xml manpage.xsl
12 xsltproc --nonet ${MANPAGE_DOCBOOK_XSL} $< > $@
13
14TEXT = $(wildcard *.txt)
15XML = $(patsubst %.txt,%.xsl, ${TEXT})
16MAN = $(patsubst %.txt,%.1, ${TEXT})
17
18all: ${MAN}
19
20manpage.xsl:
21 @if [ ! -f ${MANPAGE_DOCBOOK_XSL} ]; then \
22 echo "*********************************"; \
23 echo "** No docbook.xsl is installed **"; \
24 echo "** Can't make man pages **"; \
25 echo "*********************************"; \
26 fi
27
28clean:
29 $(RM) *.xml *.1
diff --git a/Makefile b/Makefile
index 481b1a7..721cdec 100644
--- a/Makefile
+++ b/Makefile
@@ -302,6 +302,12 @@ force:
302TAGS: force 302TAGS: force
303 find . -name '*.[ch]' | xargs etags 303 find . -name '*.[ch]' | xargs etags
304 304
305doc:
306 $(MAKE) -C Documentation all
307
308doc_clean:
309 $(MAKE) -C Documentation clean
310
305clean: 311clean:
306 $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d 312 $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d
307 313