diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2010-03-08 22:19:02 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-03-08 22:19:02 -0500 |
| commit | 9daa31e0ad4164bf41d8d10cc1630ec3ef9f398c (patch) | |
| tree | b6558f0fee210d90eb6da894cc37b6c2ecfb0c26 | |
| parent | efc0bfac7b966fbf4776f11a7922d6c0d92e7ac8 (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/.gitignore | 1 | ||||
| -rw-r--r-- | Documentation/Makefile | 29 | ||||
| -rw-r--r-- | Makefile | 6 |
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 | # | ||
| 6 | MANPAGE_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 | |||
| 14 | TEXT = $(wildcard *.txt) | ||
| 15 | XML = $(patsubst %.txt,%.xsl, ${TEXT}) | ||
| 16 | MAN = $(patsubst %.txt,%.1, ${TEXT}) | ||
| 17 | |||
| 18 | all: ${MAN} | ||
| 19 | |||
| 20 | manpage.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 | |||
| 28 | clean: | ||
| 29 | $(RM) *.xml *.1 | ||
| @@ -302,6 +302,12 @@ force: | |||
| 302 | TAGS: force | 302 | TAGS: force |
| 303 | find . -name '*.[ch]' | xargs etags | 303 | find . -name '*.[ch]' | xargs etags |
| 304 | 304 | ||
| 305 | doc: | ||
| 306 | $(MAKE) -C Documentation all | ||
| 307 | |||
| 308 | doc_clean: | ||
| 309 | $(MAKE) -C Documentation clean | ||
| 310 | |||
| 305 | clean: | 311 | clean: |
| 306 | $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d | 312 | $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d |
| 307 | 313 | ||
