diff options
Diffstat (limited to 'doc/Makefile')
-rw-r--r-- | doc/Makefile | 136 |
1 files changed, 89 insertions, 47 deletions
diff --git a/doc/Makefile b/doc/Makefile index 306bd4d..59d25d5 100644 --- a/doc/Makefile +++ b/doc/Makefile | |||
@@ -1,6 +1,11 @@ | |||
1 | #Path to this subsystem's root directory | 1 | #Path to this subsystem's root directory |
2 | SUBSYSROOT := $(shell pwd) | 2 | SUBSYSROOT := $(shell pwd) |
3 | 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. Includes TMPCLONEROOT | ||
4 | include init.mk | 9 | include init.mk |
5 | 10 | ||
6 | # ****************** SUPPORT FOR TARGETS *************************** | 11 | # ****************** SUPPORT FOR TARGETS *************************** |
@@ -15,8 +20,10 @@ TARGETDEFAULTXMLS := $(shell cd $(REPODIR); ls -1 */default.xml) | |||
15 | # URL and HASH of this manifest repository to be used by the repo tool | 20 | # URL and HASH of this manifest repository to be used by the repo tool |
16 | CURRENTHASH := $(shell git log -1 --pretty=format:%H 2>/dev/null) | 21 | CURRENTHASH := $(shell git log -1 --pretty=format:%H 2>/dev/null) |
17 | CURRENTURL := $(shell git remote show origin | sed -n '/Fetch URL: /s/^.*URL: //p' 2>/dev/null) | 22 | CURRENTURL := $(shell git remote show origin | sed -n '/Fetch URL: /s/^.*URL: //p' 2>/dev/null) |
18 | .PHONY: inittargets | 23 | |
19 | # ****************************************************************** | 24 | # ******************* AutoGenerated chapter from template and target READMEs ******* |
25 | BUILDBOOT_XML := book-enea-linux-release-info/doc/build_boot_generated.xml | ||
26 | BUILDBOOT_TEMPLATE := book-enea-linux-release-info/doc/build_boot_template.xml | ||
20 | 27 | ||
21 | 28 | ||
22 | 29 | ||
@@ -33,27 +40,10 @@ DOCBOOK_FO_USEFOP ?= yes | |||
33 | DOCBOOK_TO_BOOKDIR ?= yes | 40 | DOCBOOK_TO_BOOKDIR ?= yes |
34 | DOCBOOK_CLEANTMP ?= yes | 41 | DOCBOOK_CLEANTMP ?= yes |
35 | 42 | ||
36 | #Components in this subsystem | 43 | #Components (books) in this subsystem |
37 | COMPONENTS := book-enea-linux-release-info book-enea-linux-open-source | 44 | # COMPONENTS := book-enea-linux-release-info book-enea-linux-open-source |
38 | # COMPONENTS += book-enea-linux-target-guide | 45 | # COMPONENTS += book-enea-linux-eclipse-open-source |
39 | # ----------------------------------------------------- | 46 | COMPONENTS := $(shell ls -d book-enea* ) |
40 | #Release version, used in labels and text | ||
41 | REL_VER_EXT := $(shell perl -e \ | ||
42 | 'while(<>) {\ | ||
43 | if (/<!ENTITY ENEA_LINUX_REL_VER "([\d\.-\w]+)">/) { print $$1 ; exit; }\ | ||
44 | }' \ | ||
45 | < $(SUBSYSROOT)/docsrc_common/pardoc-distro.xml 2>/dev/null) | ||
46 | #$(info REL_VER_EXT = $(REL_VER_EXT)) | ||
47 | |||
48 | ifneq ($(REL_VER_EXT),) | ||
49 | REL_VER ?= $(REL_VER_EXT) | ||
50 | else | ||
51 | REL_VER ?= undefined | ||
52 | endif | ||
53 | $(info REL_VER = $(REL_VER)) | ||
54 | |||
55 | # ----------------------------------------------------- | ||
56 | |||
57 | 47 | ||
58 | # -------------------------------------------------------------- | 48 | # -------------------------------------------------------------- |
59 | ifeq ($(VERBOSE),yes) | 49 | ifeq ($(VERBOSE),yes) |
@@ -76,34 +66,31 @@ VALIDATE = no | |||
76 | # Export all parameters including those on the command line | 66 | # Export all parameters including those on the command line |
77 | export | 67 | export |
78 | 68 | ||
79 | .PHONY: doc books docusage | 69 | .PHONY: doc books docusage init initbuild inittargets initpardoc initbuildboot |
80 | 70 | ||
81 | 71 | ||
82 | docusage: | 72 | docusage: |
83 | @echo 'make docusage #Shows this help text' | 73 | @echo 'make docusage #Shows this help text' |
84 | @echo ' DOCBOOK_TOOLS_VERSIONS=yes #Displays DocBook tools versions in this machine' | 74 | @echo ' DOCBOOK_TOOLS_VERSIONS=yes #Displays DocBook tools versions in this machine' |
85 | @echo 'make doc #Builds the userdoc, does autoinit if needed' | 75 | @echo 'make doc #Builds the userdoc, does autoinit if needed' |
86 | @echo 'make init #Init both below' | 76 | @echo 'make init #Init all needed init* below' |
87 | @echo 'make initbuild #Init s_docbuild' | 77 | @echo 'make initbuild #Init s_docbuild Docbook build system and central files' |
88 | @echo 'make inittargets #Init s_targets using repo tool' | 78 | @echo 'make inittargets #Init s_targets using repo tool Targets in this distro with poky' |
79 | @echo 'make initpardoc #Init s_docsrc_common using info from poky/' | ||
80 | @echo 'make initbuildboot #Init build_boot chapter from READMEs and template in release info' | ||
89 | @echo ' DOCBOOK_CLEANTMP=no #Option to keep temp files in doc/ and tmp/' | 81 | @echo ' DOCBOOK_CLEANTMP=no #Option to keep temp files in doc/ and tmp/' |
90 | @echo ' BOOK_GLOBALCLONEROOT=yes #Option for all init above to clone all outside the doc directory' | 82 | @echo ' BOOK_GLOBALCLONEROOT=yes #Option for all init above to clone all outside the doc directory' |
91 | @echo ' BOOK_GLOBALCLONEROOT=otherpath #Option for all init above to clone all' | 83 | @echo ' BOOK_GLOBALCLONEROOT=otherpath #Option for all init above to clone all' |
92 | @echo #Force rebuilding (ignore dependency on file times or BL_LABEL)' | 84 | @echo 'make pullbuild #git pull in s_docbuild' |
93 | @echo ' # Dependency only works if common doc directory is kept' | 85 | @echo 'make pulltargets #git pull in s_targets. You need also initpardoc initbuildboot' |
94 | @echo ' BOOKCONDITION'make pullbuild #git pull in s_docbuild' | ||
95 | @echo 'make pulltargets #git pull in s_targets' | ||
96 | @echo 'make clean #Clean. Also clean s_* but not any external clones' | 86 | @echo 'make clean #Clean. Also clean s_* but not any external clones' |
97 | @echo 'The following directories are cloned via the init commands (s_* are symlinks to clones):' | ||
98 | @echo ' s_docbuild #Docbook build system and central files' | ||
99 | @echo ' s_targets #targets in this distro with poky, for picking some parameters' | ||
100 | @echo '' | 87 | @echo '' |
101 | @echo 'Optional parameters for make doc:' | 88 | @echo 'Optional parameters for make doc:' |
102 | @echo ' COMP=<book-directory> #Component (book) to build. Book component names are book-*' | 89 | @echo ' COMP=<book-directory> #Component (book) to build. Book component names are book-*' |
103 | @echo ' #Default component/s:' | 90 | @echo ' #Default component/s:' |
104 | @echo ' $(COMPONENTS)' | 91 | @echo ' $(COMPONENTS)' |
105 | @echo ' FORMAT=<format> #One of: pdf, html, or eclipse (Default all are built)' | 92 | @echo ' FORMAT=<format> #One of: pdf, html, or eclipse (Default all are built)' |
106 | @echo ' BL_LABEL=<baseline> #Becomes footer in book (default: date + time)' | 93 | @echo ' BL_LABEL=<baseline> #Becomes footer in book (default: from poky enea.conf MAJORMINOR)' |
107 | @echo ' DOCBOOK_TO_BOOKDIR=no #(default yes) Avoid moving result to book directory' | 94 | @echo ' DOCBOOK_TO_BOOKDIR=no #(default yes) Avoid moving result to book directory' |
108 | @echo ' # and avoid erasing common doc and tmp directories' | 95 | @echo ' # and avoid erasing common doc and tmp directories' |
109 | @echo ' BOOKFORCE=yes #Force rebuilding (ignore dependency on file times or BL_LABEL)' | 96 | @echo ' BOOKFORCE=yes #Force rebuilding (ignore dependency on file times or BL_LABEL)' |
@@ -118,7 +105,7 @@ docusage: | |||
118 | @echo ' DOCBOOK_OLINK_TARGETDB=only #Build a target db for this book (for links into it)' | 105 | @echo ' DOCBOOK_OLINK_TARGETDB=only #Build a target db for this book (for links into it)' |
119 | @echo ' DOCBOOK_OLINK_TARGETDB=yes #Build a target db AND build the book' | 106 | @echo ' DOCBOOK_OLINK_TARGETDB=yes #Build a target db AND build the book' |
120 | @echo ' #Master olinkdb defined in this Makefile, one per generated format, is:' | 107 | @echo ' #Master olinkdb defined in this Makefile, one per generated format, is:' |
121 | @echo ' $(DOCBOOKOLINKDB_BASE)_*.db' | 108 | @echo ' $(DOCBOOKOLINKDB_BASE)_*.db' |
122 | @echo ' Typical examples:' | 109 | @echo ' Typical examples:' |
123 | @echo ' make doc Creates all books, all formats' | 110 | @echo ' make doc Creates all books, all formats' |
124 | @echo ' make doc COMP=book-xxxx FORMAT=html' | 111 | @echo ' make doc COMP=book-xxxx FORMAT=html' |
@@ -137,7 +124,8 @@ ifeq ($(DOCBOOK_TOOLS_VERSIONS),yes) | |||
137 | $(VERB)$(MAKE) -f $(DOCBOOKMAKE)/tools_book_standalone.mk book_tools_versions | 124 | $(VERB)$(MAKE) -f $(DOCBOOKMAKE)/tools_book_standalone.mk book_tools_versions |
138 | endif | 125 | endif |
139 | 126 | ||
140 | init: initbuild inittargets | 127 | # We rely on make doing these in order left to right |
128 | init: initbuild inittargets initpardoc initbuildboot | ||
141 | pullall: pullbuild pulltargets | 129 | pullall: pullbuild pulltargets |
142 | 130 | ||
143 | # If no COMP, iterate over books-* in COMPONENTS with make doc | 131 | # If no COMP, iterate over books-* in COMPONENTS with make doc |
@@ -163,24 +151,27 @@ FORMAT=html pdf eclipse | |||
163 | endif | 151 | endif |
164 | 152 | ||
165 | 153 | ||
166 | books: initbuild inittargets | 154 | books: init |
167 | # BOOKPACKAGES is defined in all book-*/swcomp.mk | 155 | # BOOKPACKAGES is defined in all book-*/swcomp.mk |
168 | $(VERB)for book in $(BOOKPACKAGES); do \ | 156 | $(VERB)DISTRO_VERSION_MAJOR=`egrep '"EneaLinux_DISTRO_VERSION_MAJOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \ |
157 | DISTRO_VERSION_MINOR=`egrep '"EneaLinux_DISTRO_VERSION_MINOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \ | ||
158 | BOOKVER="Profile $(MANIFEST_TAIL)-$$DISTRO_VERSION_MAJOR$$DISTRO_VERSION_MINOR" ; \ | ||
159 | for book in $(BOOKPACKAGES); do \ | ||
169 | for format in $(FORMAT); do \ | 160 | for format in $(FORMAT); do \ |
170 | $(MAKE) -f $(DOCBOOKMAKE)/make_docbook_standalone.mk BOOK=$$book FORMAT=$$format books || exit 10; \ | 161 | $(MAKE) -f $(DOCBOOKMAKE)/make_docbook_standalone.mk BOOK=$$book FORMAT=$$format BOOK_VER="$$BOOKVER" books || exit 10; \ |
171 | done ; \ | 162 | done ; \ |
172 | done | 163 | done |
173 | ifeq ($(DOCBOOK_TO_BOOKDIR),yes) | 164 | ifeq ($(DOCBOOK_TO_BOOKDIR),yes) |
174 | $(VERB)rm -rf doc tmp | 165 | $(VERB)rm -rf doc tmp |
175 | else | 166 | else |
176 | ifeq ($(DOCBOOK_CLEANTMP),yes) | 167 | ifeq ($(DOCBOOK_CLEANTMP),yes) |
177 | # keep only doc/pdf/book-*.pdf doc/eclipse/plugins/com.enea.doc.book-* but delete doc/eclipse/plugins/com.enea.doc.book-*/done* | 168 | # keep only doc/pdf/book-*.pdf doc/eclipse/plugins/com.enea.doc.book-* but delete doc/eclipse/plugins/com.enea.doc.book-*/done* |
178 | $(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 | 169 | $(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 |
179 | endif | 170 | endif |
180 | endif | 171 | endif |
181 | 172 | ||
182 | 173 | # cleaninit cleans ALL tmpcommon and all s_* and generated build_boot chapter xml | |
183 | clean: cleaninit | 174 | clean: cleaninit cleanbuildboot |
184 | $(VERB)rm -rf doc tmp 2>/dev/null | 175 | $(VERB)rm -rf doc tmp 2>/dev/null |
185 | ifneq ($(filter book-%, $(COMPONENTS)),) | 176 | ifneq ($(filter book-%, $(COMPONENTS)),) |
186 | $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ | 177 | $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ |
@@ -221,4 +212,55 @@ $(TMPCLONEROOT_TARGETS): | |||
221 | repo init -u $(CURRENTURL) -b $(CURRENTHASH) -m $$target_default_xml ; repo sync ; \ | 212 | repo init -u $(CURRENTURL) -b $(CURRENTHASH) -m $$target_default_xml ; repo sync ; \ |
222 | ) ; \ | 213 | ) ; \ |
223 | done | 214 | done |
224 | # ****************************************************************** | 215 | |
216 | # **************************************************************************** | ||
217 | # ******************** SUPPORT FOR dynamic pardoc with added parameters ****** | ||
218 | # pardoc-distro can contain MAJOR.MINOR-xxxxx keeping -xxxx when replacing MINOR.MINOR from enea.conf | ||
219 | |||
220 | PATH_DOCSRC_COMMON = $(SUBSYSROOT)/s_docsrc_common | ||
221 | NAME_DOCSRC_COMMON = docsrc_common | ||
222 | TMPCLONEROOT_DOCSRC_COMMON := $(TMPCLONEROOT)/$(NAME_DOCSRC_COMMON) | ||
223 | TMPPARDOC := $(TMPCLONEROOT_DOCSRC_COMMON)/pardoc-distro.xml | ||
224 | |||
225 | initpardoc: s_docsrc_common | ||
226 | |||
227 | cleanpardoc: | ||
228 | $(VERB)rm -rf $(TMPCLONEROOT_DOCSRC_COMMON) ; rm s_docsrc_common | ||
229 | |||
230 | s_docsrc_common: $(TMPCLONEROOT_DOCSRC_COMMON) | ||
231 | $(VERB)rm s_docsrc_common 2>/dev/null; ln -s $(TMPCLONEROOT_DOCSRC_COMMON) s_docsrc_common | ||
232 | |||
233 | $(TMPCLONEROOT_DOCSRC_COMMON): s_targets | ||
234 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi | ||
235 | $(VERB)if [ ! -d $(TMPCLONEROOT_DOCSRC_COMMON) ]; then mkdir -p $(TMPCLONEROOT_DOCSRC_COMMON) ; fi | ||
236 | @echo "Copy and patch docsrc_common/ files to $(TMPCLONEROOT_DOCSRC_COMMON)" | ||
237 | $(VERB)FIRSTTARGET=`ls -1 s_targets/ | head -1`; \ | ||
238 | ENEACONF=s_targets/$$FIRSTTARGET/poky/meta-el-common/conf/distro/enea.conf ; \ | ||
239 | DISTRO_VERSION_MAJOR=`egrep '^DISTRO_VERSION_MAJOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ | ||
240 | DISTRO_VERSION_MINOR=`egrep '^DISTRO_VERSION_MINOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ | ||
241 | cat docsrc_common/pardoc-distro.xml | sed '/<\/section>/d' | \ | ||
242 | sed '/<!ENTITY ENEA_LINUX_REL_VER/s/MAJOR.MINOR/'"$$DISTRO_VERSION_MAJOR$$DISTRO_VERSION_MINOR"'/' | \ | ||
243 | sed '/<!ENTITY . common_poky_entities SYSTEM/s/s_targets\/[^\/]*\/poky/s_targets\/'"$$FIRSTTARGET"'\/poky/' >$(TMPPARDOC) ; \ | ||
244 | echo "<para id=\"EneaLinux_DISTRO_VERSION_MAJOR\"><phrase>$$DISTRO_VERSION_MAJOR</phrase></para>" >>$(TMPPARDOC) ; \ | ||
245 | echo "<para id=\"EneaLinux_DISTRO_VERSION_MINOR\"><phrase>$$DISTRO_VERSION_MINOR</phrase></para>" >>$(TMPPARDOC) ; \ | ||
246 | echo "</section>" >>$(TMPPARDOC) | ||
247 | |||
248 | # **************************************************************************** | ||
249 | # ***** Create XML chapter with build/boot commands from all README files in s_targets | ||
250 | |||
251 | initbuildboot: $(BUILDBOOT_XML) | ||
252 | |||
253 | cleanbuildboot: | ||
254 | $(VERB)rm -f $(BUILDBOOT_XML) 2>/dev/null | ||
255 | |||
256 | |||
257 | $(BUILDBOOT_XML): s_targets $(BUILDBOOT_TEMPLATE) | ||
258 | @echo "Creating $(BUILDBOOT_XML) from READMEs" | ||
259 | $(VERB)INITBB_CMD=initbuildboot.sh ; \ | ||
260 | if [ -f "$$INITBB_CMD" ]; then \ | ||
261 | sh "$$INITBB_CMD" -xml $(BUILDBOOT_XML) -template $(BUILDBOOT_TEMPLATE) ; \ | ||
262 | else \ | ||
263 | echo "ERROR: Missing $$INITBB_CMD, can not create $(BUILDBOOT_XML)"; exit 10; \ | ||
264 | fi | ||
265 | |||
266 | # **************************************************************************** | ||