Skip to content
Newer
Older
100644 78 lines (64 sloc) 2.49 KB
ae333e4 hue (formerly Cloudera Desktop) from internal commit 4694ac0434dad851…
bcwalrus authored
1 #
2 # Licensed to Cloudera, Inc. under one
3 # or more contributor license agreements. See the NOTICE file
4 # distributed with this work for additional information
5 # regarding copyright ownership. Cloudera, Inc. licenses this file
6 # to you under the Apache License, Version 2.0 (the
7 # "License"); you may not use this file except in compliance
8 # with the License. You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18
19 export ROOT := $(realpath ..)
20 include $(ROOT)/Makefile.vars.priv
21
22 .PHONY: default docs
23
24 default: docs
25 docs: $(BLD_DIR_DOC)
26
27 # Option for a2x
28 NO_TOC := --xsltproc-opts='--stringparam generate.toc ""'
29
30 #
840b819 HUE-192. Doc build should generate html for release notes
bc Wong authored
31 # Being lazy/loose with the prerequsite. Include all files except sdk and
32 # release notes, which are handled separately below.
ae333e4 hue (formerly Cloudera Desktop) from internal commit 4694ac0434dad851…
bcwalrus authored
33 #
840b819 HUE-192. Doc build should generate html for release notes
bc Wong authored
34 DOC_FILES := $(shell find . -name sdk -prune -o -name release-notes -o -print)
35 $(BLD_DIR_DOC): sdk release-notes $(DOC_FILES)
ae333e4 hue (formerly Cloudera Desktop) from internal commit 4694ac0434dad851…
bcwalrus authored
36 @echo '--- Generating doc at $@'
37 @mkdir -p $@
38
39 @a2x $(NO_TOC) --icons --icons-dir=images --format=xhtml --stylesheet=docbook.css -D $@ index.txt
40 @a2x --asciidoc-opts="-a toc.max.depth=4" --format=xhtml --icons --icons-dir=images --stylesheet=docbook.css -D $@ manual.txt
41 @rm -f {index,manual}.xml
42
43 @cp docbook.css $@
44 @cp *.repo $@
45 @# Remove intermediate file
46 @rsync -a images $@/
47
48
840b819 HUE-192. Doc build should generate html for release notes
bc Wong authored
49 .PHONY: release-notes
50 release-notes: $(BLD_DIR_DOC)/release-notes
fcce3b6 HUE-469. 'make docs' returns 0 even on error, could use a more restri…
bc Wong authored
51 $(BLD_DIR_DOC)/release-notes: $(wildcard release-notes/*.txt)
840b819 HUE-192. Doc build should generate html for release notes
bc Wong authored
52 @echo '--- Generating release notes at $@'
53 @mkdir -p $@
54 @for i in $? ; do asciidoc $$i ; done
55 @mv release-notes/*.html $@/
56 @echo "--- Generated $@"
57
58
59 .PHONY: sdk
60 sdk: $(BLD_DIR_DOC)/sdk/sdk.html
61 $(BLD_DIR_DOC)/sdk/sdk.html: $(shell find sdk -type f)
ae333e4 hue (formerly Cloudera Desktop) from internal commit 4694ac0434dad851…
bcwalrus authored
62 @echo '--- Generating sdk doc at $@'
263d320 HUE-234. `make docs` creates the wrong sdk directory
bc Wong authored
63 @mkdir -p $(@D)
64 @cp sdk/*.png $(@D)
65 @cp docbook.css $(@D)
ae333e4 hue (formerly Cloudera Desktop) from internal commit 4694ac0434dad851…
bcwalrus authored
66 @# This is somewhat heinous, but works fine and avoids the need
67 @# to install markdown on developer systems, or depend on building
68 @# out the virtual env to build sdk docs
93372ce [build] Markdown requires elementtree when generating docs
bc Wong authored
69 @PYTHONPATH=$(DESKTOP_DIR)/core/ext-py/markdown:$(DESKTOP_DIR)/core/ext-py/elementtree \
ae333e4 hue (formerly Cloudera Desktop) from internal commit 4694ac0434dad851…
bcwalrus authored
70 $(DESKTOP_DIR)/core/ext-py/markdown/bin/markdown \
263d320 HUE-234. `make docs` creates the wrong sdk directory
bc Wong authored
71 sdk/sdk.md -x toc > $@
840b819 HUE-192. Doc build should generate html for release notes
bc Wong authored
72 @echo "--- Generated $@"
73
ae333e4 hue (formerly Cloudera Desktop) from internal commit 4694ac0434dad851…
bcwalrus authored
74
75 clean:
76 @echo '--- Removing $(BLD_DIR_DOC)'
77 @rm -rf $(BLD_DIR_DOC)
Something went wrong with that request. Please try again.