1 |
From: "W. Trevor King" <wking@×××××××.us> |
2 |
|
3 |
The rules are more general though; any new *.txt file in doc/ that |
4 |
doesn't match *.?.txt or one of the explicitly-listed *.generated.txt |
5 |
files will be automatically built and distributed. |
6 |
|
7 |
The generated `files/docbook-xsl.css` is a side effect of the xhtml |
8 |
target. |
9 |
--- |
10 |
Makefile | 15 ++++++++++++--- |
11 |
1 file changed, 12 insertions(+), 3 deletions(-) |
12 |
|
13 |
diff --git a/Makefile b/Makefile |
14 |
index 016120a..98accbe 100644 |
15 |
--- a/Makefile |
16 |
+++ b/Makefile |
17 |
@@ -5,15 +5,18 @@ PACKAGE_VERSION = `fgrep '__version__=' catalyst | sed 's|^__version__="\(.*\)"$ |
18 |
MAN_PAGE_SOURCES = $(wildcard doc/*.?.txt) |
19 |
MAN_PAGES = $(patsubst doc/%.txt,files/%,$(MAN_PAGE_SOURCES)) |
20 |
MAN_PAGE_INCLUDES = doc/subarches.generated.txt doc/targets.generated.txt |
21 |
-EXTRA_DIST = $(MAN_PAGES) |
22 |
-GENERATED_FILES = $(MAN_PAGES) $(MAN_PAGE_INCLUDES) |
23 |
+DOC_SOURCES = $(filter-out $(MAN_PAGE_SOURCES) $(MAN_PAGE_INCLUDES),$(wildcard doc/*.txt)) |
24 |
+DOCS = $(patsubst doc/%.txt,files/%.html,$(DOC_SOURCES)) |
25 |
+DOC_SIDE_EFFECTS = files/docbook-xsl.css |
26 |
+EXTRA_DIST = $(MAN_PAGES) $(DOCS) $(DOC_SIDE_EFFECTS) |
27 |
+GENERATED_FILES = $(MAN_PAGES) $(MAN_PAGE_INCLUDES) $(DOCS) $(DOC_SIDE_EFFECTS) |
28 |
|
29 |
distdir = catalyst-$(PACKAGE_VERSION) |
30 |
|
31 |
|
32 |
all: $(EXTRA_DIST) |
33 |
|
34 |
-files/%: doc/%.txt doc/asciidoc.conf Makefile catalyst |
35 |
+$(MAN_PAGES): files/%: doc/%.txt doc/asciidoc.conf Makefile catalyst |
36 |
a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \ |
37 |
--format=manpage -D files "$<" |
38 |
|
39 |
@@ -27,6 +30,12 @@ doc/subarches.generated.txt: $(wildcard arch/*.py) doc/make_subarch_table_guidex |
40 |
doc/targets.generated.txt: doc/make_target_table.py $(wildcard modules/*_target.py) |
41 |
"./$<" > "$@" |
42 |
|
43 |
+$(DOCS): files/%.html: doc/%.txt doc/asciidoc.conf Makefile |
44 |
+ a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \ |
45 |
+ --format=xhtml -D files "$<" |
46 |
+ |
47 |
+$(DOC_SIDE_EFFECTS): $(firstword $(DOCS)) |
48 |
+ |
49 |
clean: |
50 |
rm -f $(GENERATED_FILES) |
51 |
find -name '*.pyo' -delete |
52 |
-- |
53 |
1.8.1.336.g94702dd |