diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-03-25 22:57:32 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-03-25 22:57:32 -0400 |
commit | 190f587a956789c033583aafd8186eb4ddbebbe1 (patch) | |
tree | c62510c1ebfbdce437a4f8bddff7c623b56c23cc | |
parent | 1e2461ac3a5bbc9104d4aa14d41c351e2e20820b (diff) |
build: Make doc build handle O=/path/to/output/dir
Update the Documentation Makefile to handle building outside the source tree.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | Documentation/Makefile | 19 | ||||
-rw-r--r-- | Makefile | 6 |
2 files changed, 15 insertions, 10 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile index 87c38ae..758897c 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile | |||
@@ -1,19 +1,23 @@ | |||
1 | 1 | ||
2 | obj := $(obj)/Documentation | ||
3 | src := $(src)/Documentation | ||
4 | |||
2 | # | 5 | # |
3 | # Most likely a docbook.xsl is already installed on the users system | 6 | # 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. | 7 | # instead of creating a new wheel, lets reuse what's already there. |
5 | # | 8 | # |
6 | MANPAGE_DOCBOOK_XSL = $(shell locate manpages/docbook.xsl | head -1) | 9 | MANPAGE_DOCBOOK_XSL = $(shell locate manpages/docbook.xsl | head -1) |
7 | 10 | ||
8 | %.xml: %.txt | 11 | $(obj)/%.xml: $(src)/%.txt |
9 | asciidoc -d manpage -b docbook $< | 12 | mkdir -p $(obj) |
13 | asciidoc -d manpage -b docbook -o $@ $< | ||
10 | 14 | ||
11 | %.1: %.xml manpage.xsl | 15 | $(obj)/%.1: $(obj)/%.xml manpage.xsl |
12 | xsltproc --nonet ${MANPAGE_DOCBOOK_XSL} $< > $@ | 16 | xsltproc --nonet -o $@ ${MANPAGE_DOCBOOK_XSL} $< |
13 | 17 | ||
14 | TEXT = $(wildcard *.txt) | 18 | TEXT = $(wildcard *.txt) |
15 | XML = $(patsubst %.txt,%.xsl, ${TEXT}) | 19 | XML = $(patsubst %.txt,$(obj)/%.xsl, ${TEXT}) |
16 | MAN = $(patsubst %.txt,%.1, ${TEXT}) | 20 | MAN = $(patsubst %.txt,$(obj)/%.1, ${TEXT}) |
17 | 21 | ||
18 | all: ${MAN} | 22 | all: ${MAN} |
19 | 23 | ||
@@ -26,4 +30,5 @@ manpage.xsl: | |||
26 | fi | 30 | fi |
27 | 31 | ||
28 | clean: | 32 | clean: |
29 | $(RM) *.xml *.1 | 33 | (cd $(obj); \ |
34 | $(RM) *.xml *.1) | ||
@@ -82,7 +82,7 @@ objtree := $(CURDIR) | |||
82 | src := $(srctree) | 82 | src := $(srctree) |
83 | obj := $(objtree) | 83 | obj := $(objtree) |
84 | 84 | ||
85 | export prefix bindir | 85 | export prefix bindir src obj |
86 | 86 | ||
87 | # Shell quotes | 87 | # Shell quotes |
88 | bindir_SQ = $(subst ','\'',$(bindir)) | 88 | bindir_SQ = $(subst ','\'',$(bindir)) |
@@ -419,10 +419,10 @@ install_gui: install_cmd gui | |||
419 | $(Q)$(call do_install, kernelshark, '$(bindir_SQ)') | 419 | $(Q)$(call do_install, kernelshark, '$(bindir_SQ)') |
420 | 420 | ||
421 | doc: | 421 | doc: |
422 | $(MAKE) -C Documentation all | 422 | $(MAKE) -C $(src)/Documentation all |
423 | 423 | ||
424 | doc_clean: | 424 | doc_clean: |
425 | $(MAKE) -C Documentation clean | 425 | $(MAKE) -C $(src)/Documentation clean |
426 | 426 | ||
427 | clean: | 427 | clean: |
428 | $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d | 428 | $(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d |