diff options
Diffstat (limited to 'doc/Makefile')
-rw-r--r-- | doc/Makefile | 315 |
1 files changed, 0 insertions, 315 deletions
diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index a562a0a..0000000 --- a/doc/Makefile +++ /dev/null | |||
@@ -1,315 +0,0 @@ | |||
1 | #Path to this subsystem's root directory | ||
2 | SUBSYSROOT := $(shell pwd) | ||
3 | |||
4 | MANIFEST_DIR = $(dir $(SUBSYSROOT)) | ||
5 | MANIFEST_NAME = $(lastword $(subst /, ,$(MANIFEST_DIR))) | ||
6 | MANIFEST_TAIL = $(word 2,$(subst -, ,$(MANIFEST_NAME))) | ||
7 | |||
8 | # Generic docbuild.git auto-clone + s_docbuild symlink. | ||
9 | # Defines TMPCLONEROOT which optionally can be nondefault using BOOK_GLOBALCLONEROOT | ||
10 | include init.mk | ||
11 | |||
12 | # ****************** SUPPORT FOR TARGETS *************************** | ||
13 | PATH_TARGETS = $(SUBSYSROOT)/s_targets | ||
14 | #Git repositories to be cloned | ||
15 | NAME_TARGETS := targets | ||
16 | #Path to the directory under which repos shall be cloned. | ||
17 | DOCBASEDIR=$(shell pwd) | ||
18 | REPODIR=$(DOCBASEDIR)/.. | ||
19 | TMPCLONEROOT_TARGETS := $(TMPCLONEROOT)/$(NAME_TARGETS) | ||
20 | TARGETDEFAULTXMLS := $(shell cd $(REPODIR); ls -1 */default.xml) | ||
21 | # URL and HASH of this manifest repository to be used by the repo tool | ||
22 | CURRENTHASH := $(shell git log -1 --pretty=format:%H 2>/dev/null) | ||
23 | CURRENTURL := $(shell git remote show origin | sed -n '/Fetch URL: /s/^.*URL: //p' 2>/dev/null) | ||
24 | |||
25 | # ******************* AutoGenerated chapter from template and target READMEs ******* | ||
26 | BUILDBOOT_XML := book-enea-linux-release-info/doc/build_boot_generated.xml | ||
27 | BUILDBOOT_TEMPLATE := book-enea-linux-release-info/doc/build_boot_template.xml | ||
28 | |||
29 | PKGDIFF_GEN_XML := book-enea-linux-release-info/doc/pkgdiff_generated.xml | ||
30 | JIRA_ISSUES_GEN_XML := book-enea-linux-release-info/doc/jiraissues_generated.xml | ||
31 | |||
32 | |||
33 | # ----------------------------------------------------- | ||
34 | #Path to DocBook make files and templates | ||
35 | DOCBOOKMAKE = $(SUBSYSROOT)/s_docbuild/docmake | ||
36 | DOCBOOKTEMPLATE = $(SUBSYSROOT)/s_docbuild/template | ||
37 | |||
38 | #Path to the OLINK database including leading part of file name (will add -$(FORMAT).db) | ||
39 | DOCBOOKOLINKDB_BASE = $(SUBSYSROOT)/s_docbuild/olinkdb/olink-targetdb-master | ||
40 | |||
41 | DOCBOOK_OLINKS ?= yes | ||
42 | DOCBOOK_FO_USEFOP ?= yes | ||
43 | DOCBOOK_TO_BOOKDIR ?= yes | ||
44 | DOCBOOK_CLEANTMP ?= yes | ||
45 | |||
46 | #Components (books) in this subsystem | ||
47 | # COMPONENTS := book-enea-linux-release-info book-enea-linux-open-source | ||
48 | # COMPONENTS += book-enea-linux-eclipse-open-source | ||
49 | COMPONENTS := $(shell ls -d book-enea* ) | ||
50 | |||
51 | # -------------------------------------------------------------- | ||
52 | ifeq ($(VERBOSE),yes) | ||
53 | VERB := | ||
54 | else | ||
55 | VERB := @ | ||
56 | endif | ||
57 | MAKEFLAGS += --no-print-directory | ||
58 | MAKEFLAGS += --directory $(SUBSYSROOT) | ||
59 | MAKEFLAGS += --no-builtin-rules --no-builting-variables | ||
60 | |||
61 | # Skip xml validation to make it possible to include xml files with unresolved | ||
62 | # links from book-enea-linux-users-guide | ||
63 | VALIDATE = no | ||
64 | |||
65 | # BL_LABEL is either given on make command line or using BOOK_VER or defaults to a timestamp | ||
66 | |||
67 | # ****************************************************************** | ||
68 | |||
69 | # Export all parameters including those on the command line | ||
70 | export | ||
71 | |||
72 | .PHONY: doc books docusage init initbuild inittargets initpardoc initbuildboot dist | ||
73 | |||
74 | |||
75 | docusage: | ||
76 | @echo 'make docusage #Shows this help text' | ||
77 | @echo ' DOCBOOK_TOOLS_VERSIONS=yes #Displays DocBook tools versions in this machine' | ||
78 | @echo 'make doc #Builds the userdoc, does autoinit if needed' | ||
79 | @echo 'make dist BOOK_DIST_DIR=xx/doc #Builds all and copies results to BOOK_DIST_DIR' | ||
80 | @echo ' #Does not work with DOCBOOK_TO_BOOKDIR or BOOK_BUILD_DIR' | ||
81 | @echo ' #Currently EclipseHelp formated doc will not be in BOOK_DIST_DIR' | ||
82 | @echo ' # unless BOOK_DIST_ECLIPSE is set to yes' | ||
83 | @echo 'make init #Init all needed init* below' | ||
84 | @echo 'make initbuild #Init s_docbuild Docbook build system and central files' | ||
85 | @echo 'make inittargets #Init s_targets using repo tool Targets in this distro with poky' | ||
86 | @echo 'make initpardoc #Init s_docsrc_common using info from poky/' | ||
87 | @echo 'make initbuildboot #Init build_boot chapter from READMEs and template in release info' | ||
88 | @echo ' DOCBOOK_CLEANTMP=no #Option to keep temp files in doc/ and tmp/' | ||
89 | @echo ' BOOK_GLOBALCLONEROOT=yes #Option for all init above to clone all outside the doc directory' | ||
90 | @echo ' BOOK_GLOBALCLONEROOT=otherpath #Option for all init above to clone all' | ||
91 | @echo 'make pullbuild #git pull in s_docbuild' | ||
92 | @echo 'make pulltargets #git pull in s_targets. You need also initpardoc initbuildboot' | ||
93 | @echo 'make clean #Clean. Also clean s_* but not any external clones' | ||
94 | @echo '' | ||
95 | @echo 'Optional parameters for make doc:' | ||
96 | @echo ' COMP=<book-directory> #Component (book) to build. Book component names are book-*' | ||
97 | @echo ' #Default component/s:' | ||
98 | @echo ' $(COMPONENTS)' | ||
99 | @echo ' FORMAT=<format> #One of: pdf, html, or eclipse (Default all are built)' | ||
100 | @echo ' BL_LABEL=<baseline> #Becomes footer in book (default: from poky enea.conf MAJORMINOR)' | ||
101 | @echo ' DOCBOOK_TO_BOOKDIR=no #(default yes) Avoid moving result to book directory' | ||
102 | @echo ' # and avoid erasing common doc and tmp directories' | ||
103 | @echo ' BOOKFORCE=yes #Force rebuilding (ignore dependency on file times or BL_LABEL)' | ||
104 | @echo ' # Dependency only works if common doc directory is kept' | ||
105 | @echo ' BOOKCONDITION="xx;yy;.." #Include XML elements with condition any of xx or yy' | ||
106 | @echo ' # (if rebuilding, BOOKFORCE=yes may be needed)' | ||
107 | @echo ' # Empty=only default. none=none, all=everything.' | ||
108 | @echo ' BOOKDEFAULTCONDITION #Default conditions, if no BOOKCONDITION. Used in book-*/swcomp.mk' | ||
109 | @echo ' SHOW_COMMENTS=yes #For proofread. Unhide <remark>..</remark> comments Only PDF' | ||
110 | @echo ' BOOKVERBOSE=yes #Verbose info building books' | ||
111 | @echo ' DOCBOOK_OLINKS=no #Avoid the olink database in Makefile (in book not using it)' | ||
112 | @echo ' DOCBOOK_OLINK_TARGETDB=only #Build a target db for this book (for links into it)' | ||
113 | @echo ' DOCBOOK_OLINK_TARGETDB=yes #Build a target db AND build the book' | ||
114 | @echo ' #Master olinkdb defined in this Makefile, one per generated format, is:' | ||
115 | @echo ' $(DOCBOOKOLINKDB_BASE)_*.db' | ||
116 | @echo ' Typical examples:' | ||
117 | @echo ' make doc Creates all books, all formats' | ||
118 | @echo ' make doc COMP=book-xxxx FORMAT=html' | ||
119 | @echo ' make doc COMP=book-xxxx FORMAT=pdf' | ||
120 | @echo ' make doc BL_LABEL="Version 1.2.3" Creates all with version in footers and front' | ||
121 | |||
122 | @echo ' Requires docbook-xsl-1.76.1 or later, docbook-xml 4.2, svg1.1, fop-1.0 + fop-hyph.jar' | ||
123 | @echo ' fop + the separate fop-hyph can be found together in package "libfop-java"' | ||
124 | @echo ' otherwise fetch fop-hyph.jar and place in same place as fop.jar' | ||
125 | @echo ' Requires libxml2-2.7.8 or later, libxslt-1.1.26 or later' | ||
126 | @echo ' Requires java machine to run fop (creating PDF). jar for optional FORMAT=eclipse' | ||
127 | @echo ' Without jar, the optional EclipseHelp format can not be built' | ||
128 | @echo ' tools_book_standalone.mk => libxml2, libxslt, and fop (and to catalog-el.xml)' | ||
129 | @echo ' catalog-el.xml => svg, docbook-xml, docbook-xsl' | ||
130 | ifeq ($(DOCBOOK_TOOLS_VERSIONS),yes) | ||
131 | $(VERB)$(MAKE) -f $(DOCBOOKMAKE)/tools_book_standalone.mk book_tools_versions | ||
132 | endif | ||
133 | |||
134 | # We rely on make doing these in order left to right | ||
135 | init: initbuild inittargets initpardoc initbuildboot initpkgdiff initissues | ||
136 | pullall: pullbuild pulltargets | ||
137 | |||
138 | # If no COMP, iterate over books-* in COMPONENTS with make doc | ||
139 | ifeq ($(COMP),) | ||
140 | doc: | ||
141 | ifneq ($(filter book-%, $(COMPONENTS)),) | ||
142 | $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ | ||
143 | $(MAKE) doc COMP=$$comp; \ | ||
144 | done | ||
145 | endif | ||
146 | |||
147 | else | ||
148 | include $(SUBSYSROOT)/$(COMP)/swcomp.mk | ||
149 | |||
150 | doc: books | ||
151 | @# | ||
152 | endif | ||
153 | |||
154 | dist: doc | ||
155 | @echo "Copying resulting built documents to $(BOOK_DIST_DIR)" | ||
156 | $(VERB)if [ "$(BOOK_DIST_DIR)" = "" ]; then echo "ERROR: Missing BOOK_DIST_DIR parameter, typically shall be xxx/doc"; exit 10; fi | ||
157 | $(VERB)if [ ! -d "`dirname $(BOOK_DIST_DIR)`" ]; then echo "ERROR: Missing parent for BOOK_DIST_DIR"; exit 10; fi | ||
158 | $(VERB)if [ -f "$(BOOK_DIST_DIR)/Makefile" ]; then echo "ERROR: Wrong BOOK_DIST_DIR, contains a Makefile?"; exit 10; fi | ||
159 | $(VERB)if [ ! -d "$(BOOK_DIST_DIR)" ]; then mkdir -p "$(BOOK_DIST_DIR)" ; fi | ||
160 | $(VERB)for book in $(COMPONENTS); do \ | ||
161 | if ls -d $$book/book*.pdf >/dev/null 2>&1; then cp --preserve=timestamps $$book/book*.pdf "$(BOOK_DIST_DIR)" ; fi ; \ | ||
162 | if ls -d $$book/html >/dev/null 2>&1; then cp -r --preserve=timestamps $$book/html "$(BOOK_DIST_DIR)" ; fi ; \ | ||
163 | if [ "$(BOOK_DIST_ECLIPSE)" = "yes" ]; then \ | ||
164 | if ls -d $$book/eclipse >/dev/null 2>&1; then cp -r --preserve=timestamps $$book/eclipse "$(BOOK_DIST_DIR)" ; fi ; \ | ||
165 | fi ; \ | ||
166 | done | ||
167 | |||
168 | # Default FORMATs | ||
169 | ifeq ($(FORMAT),) | ||
170 | FORMAT=html pdf eclipse | ||
171 | endif | ||
172 | |||
173 | |||
174 | books: init | ||
175 | # BOOKPACKAGES is defined in all book-*/swcomp.mk | ||
176 | $(VERB)DISTRO_VERSION_MAJOR=`egrep '"EneaLinux_DISTRO_VERSION_MAJOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \ | ||
177 | DISTRO_VERSION_MINOR=`egrep '"EneaLinux_DISTRO_VERSION_MINOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \ | ||
178 | BOOKVER="Profile $(MANIFEST_TAIL)-$$DISTRO_VERSION_MAJOR$$DISTRO_VERSION_MINOR" ; \ | ||
179 | for book in $(BOOKPACKAGES); do \ | ||
180 | for format in $(FORMAT); do \ | ||
181 | $(MAKE) -f $(DOCBOOKMAKE)/make_docbook_standalone.mk BOOK=$$book FORMAT=$$format BOOK_VER="$$BOOKVER" books || exit 10; \ | ||
182 | done ; \ | ||
183 | done | ||
184 | ifeq ($(DOCBOOK_TO_BOOKDIR),yes) | ||
185 | $(VERB)rm -rf doc tmp | ||
186 | else | ||
187 | ifeq ($(DOCBOOK_CLEANTMP),yes) | ||
188 | # keep only doc/pdf/book-*.pdf doc/eclipse/plugins/com.enea.doc.book-* but delete doc/eclipse/plugins/com.enea.doc.book-*/done* | ||
189 | $(VERB)rm -rf tmp 2>/dev/null ; rm -rf doc/pdf/book-*/ ; rm -rf doc/eclipse/plugins/com.enea.doc.book-*/done* 2>/dev/null | ||
190 | endif | ||
191 | endif | ||
192 | |||
193 | # cleaninit cleans ALL tmpcommon and all s_* and generated build_boot chapter xml | ||
194 | clean: cleaninit cleanbuildboot cleanpkgdiff cleanissues | ||
195 | $(VERB)rm -rf doc tmp 2>/dev/null | ||
196 | ifneq ($(filter book-%, $(COMPONENTS)),) | ||
197 | $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ | ||
198 | rm -rf $$comp/book*.pdf $$comp/html $$comp/eclipse 2>/dev/null; \ | ||
199 | done | ||
200 | $(VERB)rm -rf doc tmp 2>/dev/null | ||
201 | endif | ||
202 | |||
203 | |||
204 | # ****************************************************************** | ||
205 | # ****************** SUPPORT FOR TARGETS *************************** | ||
206 | inittargets: s_targets | ||
207 | pulltargets: | ||
208 | $(VERB)if [ ! -d s_targets ]; then echo "ERROR: No s_targets exists?" ; exit 10 ; fi | ||
209 | $(VERB)cd s_targets; for targ in *; do ( cd $targ ; git pull ) | ||
210 | |||
211 | |||
212 | # ----------------------------------------- | ||
213 | |||
214 | # Use repo to auto-clone each target separately - VERY LARGE if there are many targets (5 targets => about 1.3 Gytes) | ||
215 | |||
216 | s_targets: $(TMPCLONEROOT_TARGETS) | ||
217 | $(VERB)rm s_targets 2>/dev/null; ln -s $(TMPCLONEROOT_TARGETS) s_targets | ||
218 | |||
219 | |||
220 | $(TMPCLONEROOT_TARGETS): | ||
221 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi | ||
222 | $(VERB)if [ ! -d $(TMPCLONEROOT_TARGETS) ]; then mkdir -p $(TMPCLONEROOT_TARGETS) ; fi | ||
223 | @echo "Cloning all targets using repo tool into $(TMPCLONEROOT_TARGETS)" | ||
224 | @echo "TARGETDEFAULTXMLS is <$(TARGETDEFAULTXMLS)>" | ||
225 | $(VERB)for target_default_xml in $(TARGETDEFAULTXMLS); \ | ||
226 | do \ | ||
227 | TARGDIR=$(TMPCLONEROOT_TARGETS)/`dirname $$target_default_xml` ; \ | ||
228 | echo "TARGDIR=<$$TARGDIR>" ; \ | ||
229 | if [ ! -d $$TARGDIR ]; then mkdir -p $$TARGDIR ; fi ; \ | ||
230 | ( cd $$TARGDIR ; \ | ||
231 | echo "*** Doing repo init -u $(CURRENTURL) -b $(CURRENTHASH) -m $$target_default_xml ; repo sync"; \ | ||
232 | repo init -u $(CURRENTURL) -b $(CURRENTHASH) -m $$target_default_xml ; repo sync ; \ | ||
233 | ) ; \ | ||
234 | done | ||
235 | |||
236 | # **************************************************************************** | ||
237 | # ******************** SUPPORT FOR dynamic pardoc with added parameters ****** | ||
238 | # pardoc-distro can contain MAJOR.MINOR-xxxxx keeping -xxxx when replacing MINOR.MINOR from enea.conf | ||
239 | |||
240 | PATH_DOCSRC_COMMON = $(SUBSYSROOT)/s_docsrc_common | ||
241 | NAME_DOCSRC_COMMON = docsrc_common | ||
242 | TMPCLONEROOT_DOCSRC_COMMON := $(TMPCLONEROOT)/$(NAME_DOCSRC_COMMON) | ||
243 | TMPPARDOC := $(TMPCLONEROOT_DOCSRC_COMMON)/pardoc-distro.xml | ||
244 | |||
245 | initpardoc: s_docsrc_common | ||
246 | |||
247 | cleanpardoc: | ||
248 | $(VERB)rm -rf $(TMPCLONEROOT_DOCSRC_COMMON) ; rm s_docsrc_common | ||
249 | |||
250 | s_docsrc_common: $(TMPCLONEROOT_DOCSRC_COMMON) | ||
251 | $(VERB)rm s_docsrc_common 2>/dev/null; ln -s $(TMPCLONEROOT_DOCSRC_COMMON) s_docsrc_common | ||
252 | |||
253 | $(TMPCLONEROOT_DOCSRC_COMMON): s_targets | ||
254 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi | ||
255 | $(VERB)if [ ! -d $(TMPCLONEROOT_DOCSRC_COMMON) ]; then mkdir -p $(TMPCLONEROOT_DOCSRC_COMMON) ; fi | ||
256 | @echo "Copy and patch docsrc_common/ files to $(TMPCLONEROOT_DOCSRC_COMMON)" | ||
257 | $(VERB)FIRSTTARGET=`ls -1 s_targets/ | head -1`; \ | ||
258 | ENEACONF=s_targets/$$FIRSTTARGET/poky/meta-el-common/conf/distro/enea.conf ; \ | ||
259 | DISTRO_VERSION_MAJOR=`egrep '^DISTRO_VERSION_MAJOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ | ||
260 | DISTRO_VERSION_MINOR=`egrep '^DISTRO_VERSION_MINOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ | ||
261 | cat docsrc_common/pardoc-distro.xml | sed '/<\/section>/d' | \ | ||
262 | sed '/<!ENTITY ENEA_LINUX_REL_VER/s/MAJOR.MINOR/'"$$DISTRO_VERSION_MAJOR$$DISTRO_VERSION_MINOR"'/' | \ | ||
263 | sed '/<!ENTITY . common_poky_entities SYSTEM/s/s_targets\/[^\/]*\/poky/s_targets\/'"$$FIRSTTARGET"'\/poky/' >$(TMPPARDOC) ; \ | ||
264 | echo "<para id=\"EneaLinux_DISTRO_VERSION_MAJOR\"><phrase>$$DISTRO_VERSION_MAJOR</phrase></para>" >>$(TMPPARDOC) ; \ | ||
265 | echo "<para id=\"EneaLinux_DISTRO_VERSION_MINOR\"><phrase>$$DISTRO_VERSION_MINOR</phrase></para>" >>$(TMPPARDOC) ; \ | ||
266 | echo "</section>" >>$(TMPPARDOC) | ||
267 | |||
268 | # **************************************************************************** | ||
269 | # ***** Create XML chapter with build/boot commands from all README files in s_targets | ||
270 | |||
271 | initbuildboot: $(BUILDBOOT_XML) | ||
272 | |||
273 | cleanbuildboot: | ||
274 | $(VERB)rm -f $(BUILDBOOT_XML) 2>/dev/null | ||
275 | |||
276 | |||
277 | $(BUILDBOOT_XML): s_targets $(BUILDBOOT_TEMPLATE) | ||
278 | @echo "Creating $(BUILDBOOT_XML) from READMEs" | ||
279 | $(VERB)INITBB_CMD=initbuildboot.sh ; \ | ||
280 | if [ -f "$$INITBB_CMD" ]; then \ | ||
281 | sh "$$INITBB_CMD" -xml $(BUILDBOOT_XML) -template $(BUILDBOOT_TEMPLATE) ; \ | ||
282 | else \ | ||
283 | echo "ERROR: Missing $$INITBB_CMD, can not create $(BUILDBOOT_XML)"; exit 10; \ | ||
284 | fi | ||
285 | |||
286 | # **************************************************************************** | ||
287 | # ***** Create Package DIFF XML section | ||
288 | |||
289 | initpkgdiff: $(PKGDIFF_GEN_XML) | ||
290 | |||
291 | cleanpkgdiff: | ||
292 | $(VERB)rm -f $(PKGDIFF_GEN_XML) 2>/dev/null | ||
293 | |||
294 | $(PKGDIFF_GEN_XML): | ||
295 | $(VERB)PREVIOUS_BL=`egrep '"prev_baseline"' docsrc_common/pardoc-distro.xml | sed 's/^.*<phrase>//;s/<\/phrase>.*$$//'` ; \ | ||
296 | echo "Generating $(PKGDIFF_GEN_XML) compared to $$PREVIOUS_BL, using gen_pkgdiff.py" ; \ | ||
297 | python gen_pkgdiff.py >$(PKGDIFF_GEN_XML) | ||
298 | |||
299 | |||
300 | # **************************************************************************** | ||
301 | # ***** Create Jira Issues XML section for the known bugs chapter | ||
302 | |||
303 | .PHONY: $(JIRA_ISSUES_GEN_XML) | ||
304 | # We want new issue list to be generated also at build, not only at init | ||
305 | |||
306 | initissues: $(JIRA_ISSUES_GEN_XML) | ||
307 | |||
308 | cleanissues: | ||
309 | $(VERB)rm -f $(JIRA_ISSUES_GEN_XML) 2>/dev/null | ||
310 | |||
311 | $(JIRA_ISSUES_GEN_XML): | ||
312 | @echo "Generating $(JIRA_ISSUES_GEN_XML), fetching from Jira using gen_known_issues.py" | ||
313 | $(VERB)python gen_known_issues.py >$(JIRA_ISSUES_GEN_XML) | ||
314 | |||
315 | # **************************************************************************** | ||