diff options
Diffstat (limited to 'doc/Makefile')
-rw-r--r-- | doc/Makefile | 92 |
1 files changed, 57 insertions, 35 deletions
diff --git a/doc/Makefile b/doc/Makefile index 768b950..7fd9b52 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 *************************** |
@@ -36,23 +41,7 @@ DOCBOOK_CLEANTMP ?= yes | |||
36 | #Components in this subsystem | 41 | #Components in this subsystem |
37 | COMPONENTS := book-enea-linux-release-info book-enea-linux-open-source | 42 | COMPONENTS := book-enea-linux-release-info book-enea-linux-open-source |
38 | # COMPONENTS += book-enea-linux-eclipse-open-source | 43 | # COMPONENTS += book-enea-linux-eclipse-open-source |
39 | # ----------------------------------------------------- | 44 | # COMPONENTS += book-enea-linux-target-guide |
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 | 45 | ||
57 | 46 | ||
58 | # -------------------------------------------------------------- | 47 | # -------------------------------------------------------------- |
@@ -83,27 +72,25 @@ docusage: | |||
83 | @echo 'make docusage #Shows this help text' | 72 | @echo 'make docusage #Shows this help text' |
84 | @echo ' DOCBOOK_TOOLS_VERSIONS=yes #Displays DocBook tools versions in this machine' | 73 | @echo ' DOCBOOK_TOOLS_VERSIONS=yes #Displays DocBook tools versions in this machine' |
85 | @echo 'make doc #Builds the userdoc, does autoinit if needed' | 74 | @echo 'make doc #Builds the userdoc, does autoinit if needed' |
86 | @echo 'make init #Init both below' | 75 | @echo 'make init #Init all needed s_* below' |
87 | @echo 'make initbuild #Init s_docbuild' | 76 | @echo 'make initbuild #Init s_docbuild Docbook build system and central files' |
88 | @echo 'make inittargets #Init s_targets using repo tool' | 77 | @echo 'make inittargets #Init s_targets using repo tool Targets in this distro with poky' |
78 | @echo 'make initpardoc #Init s_docsrc_common using info from poky/' | ||
89 | @echo ' DOCBOOK_CLEANTMP=no #Option to keep temp files in doc/ and tmp/' | 79 | @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' | 80 | @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' | 81 | @echo ' BOOK_GLOBALCLONEROOT=otherpath #Option for all init above to clone all' |
92 | @echo #Force rebuilding (ignore dependency on file times or BL_LABEL)' | 82 | @echo #Force rebuilding (ignore dependency on file times or BL_LABEL)' |
93 | @echo ' # Dependency only works if common doc directory is kept' | 83 | @echo ' # Dependency only works if common doc directory is kept' |
94 | @echo ' BOOKCONDITION'make pullbuild #git pull in s_docbuild' | 84 | @echo 'make pullbuild #git pull in s_docbuild' |
95 | @echo 'make pulltargets #git pull in s_targets' | 85 | @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)' |
@@ -137,7 +124,7 @@ 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 | init: initbuild inittargets initpardoc |
141 | pullall: pullbuild pulltargets | 128 | pullall: pullbuild pulltargets |
142 | 129 | ||
143 | # If no COMP, iterate over books-* in COMPONENTS with make doc | 130 | # If no COMP, iterate over books-* in COMPONENTS with make doc |
@@ -163,23 +150,26 @@ FORMAT=html pdf eclipse | |||
163 | endif | 150 | endif |
164 | 151 | ||
165 | 152 | ||
166 | books: initbuild inittargets | 153 | books: initbuild inittargets initpardoc |
167 | # BOOKPACKAGES is defined in all book-*/swcomp.mk | 154 | # BOOKPACKAGES is defined in all book-*/swcomp.mk |
168 | $(VERB)for book in $(BOOKPACKAGES); do \ | 155 | $(VERB)DISTRO_VERSION_MAJOR=`egrep '"EneaLinux_DISTRO_VERSION_MAJOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \ |
156 | DISTRO_VERSION_MINOR=`egrep '"EneaLinux_DISTRO_VERSION_MINOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \ | ||
157 | BOOKVER="Profile $(MANIFEST_TAIL)-$$DISTRO_VERSION_MAJOR$$DISTRO_VERSION_MINOR" ; \ | ||
158 | for book in $(BOOKPACKAGES); do \ | ||
169 | for format in $(FORMAT); do \ | 159 | for format in $(FORMAT); do \ |
170 | $(MAKE) -f $(DOCBOOKMAKE)/make_docbook_standalone.mk BOOK=$$book FORMAT=$$format books || exit 10; \ | 160 | $(MAKE) -f $(DOCBOOKMAKE)/make_docbook_standalone.mk BOOK=$$book FORMAT=$$format BOOK_VER="$$BOOKVER" books || exit 10; \ |
171 | done ; \ | 161 | done ; \ |
172 | done | 162 | done |
173 | ifeq ($(DOCBOOK_TO_BOOKDIR),yes) | 163 | ifeq ($(DOCBOOK_TO_BOOKDIR),yes) |
174 | $(VERB)rm -rf doc tmp | 164 | $(VERB)rm -rf doc tmp |
175 | else | 165 | else |
176 | ifeq ($(DOCBOOK_CLEANTMP),yes) | 166 | 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* | 167 | # 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 | 168 | $(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 | 169 | endif |
180 | endif | 170 | endif |
181 | 171 | ||
182 | 172 | # cleaninit cleans ALL tmpcommon and all s_* | |
183 | clean: cleaninit | 173 | clean: cleaninit |
184 | $(VERB)rm -rf doc tmp 2>/dev/null | 174 | $(VERB)rm -rf doc tmp 2>/dev/null |
185 | ifneq ($(filter book-%, $(COMPONENTS)),) | 175 | ifneq ($(filter book-%, $(COMPONENTS)),) |
@@ -221,4 +211,36 @@ $(TMPCLONEROOT_TARGETS): | |||
221 | repo init -u $(CURRENTURL) -b $(CURRENTHASH) -m $$target_default_xml ; repo sync ; \ | 211 | repo init -u $(CURRENTURL) -b $(CURRENTHASH) -m $$target_default_xml ; repo sync ; \ |
222 | ) ; \ | 212 | ) ; \ |
223 | done | 213 | done |
224 | # ****************************************************************** | 214 | |
215 | # **************************************************************************** | ||
216 | # ******************** SUPPORT FOR dynamic pardoc with added parameters ****** | ||
217 | |||
218 | PATH_DOCSRC_COMMON = $(SUBSYSROOT)/s_docsrc_common | ||
219 | NAME_DOCSRC_COMMON = docsrc_common | ||
220 | TMPCLONEROOT_DOCSRC_COMMON := $(TMPCLONEROOT)/$(NAME_DOCSRC_COMMON) | ||
221 | TMPPARDOC := $(TMPCLONEROOT_DOCSRC_COMMON)/pardoc-distro.xml | ||
222 | .PHONY: initpardoc | ||
223 | |||
224 | initpardoc: s_docsrc_common | ||
225 | |||
226 | cleanpardoc: | ||
227 | $(VERB)rm -rf $(TMPCLONEROOT_DOCSRC_COMMON) ; rm s_docsrc_common | ||
228 | |||
229 | s_docsrc_common: $(TMPCLONEROOT_DOCSRC_COMMON) | ||
230 | $(VERB)rm s_docsrc_common 2>/dev/null; ln -s $(TMPCLONEROOT_DOCSRC_COMMON) s_docsrc_common | ||
231 | |||
232 | $(TMPCLONEROOT_DOCSRC_COMMON): s_targets | ||
233 | $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi | ||
234 | $(VERB)if [ ! -d $(TMPCLONEROOT_DOCSRC_COMMON) ]; then mkdir -p $(TMPCLONEROOT_DOCSRC_COMMON) ; fi | ||
235 | @echo "Copy and patch docsrc_common/ files to $(TMPCLONEROOT_DOCSRC_COMMON)" | ||
236 | $(VERB)FIRSTTARGET=`ls -1 s_targets/ | head -1`; echo "FIRSTTARGET is $$FIRSTTARGET" ; \ | ||
237 | ENEACONF=s_targets/$$FIRSTTARGET/poky/meta-el-common/conf/distro/enea.conf ; \ | ||
238 | DISTRO_VERSION_MAJOR=`egrep '^DISTRO_VERSION_MAJOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ | ||
239 | DISTRO_VERSION_MINOR=`egrep '^DISTRO_VERSION_MINOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ | ||
240 | cat docsrc_common/pardoc-distro.xml | sed '/<\/section>/d' | \ | ||
241 | sed '/<!ENTITY ENEA_LINUX_REL_VER/s/".*"/"'"$$DISTRO_VERSION_MAJOR$$DISTRO_VERSION_MINOR"'"/' >$(TMPPARDOC) ; \ | ||
242 | echo "<para id=\"EneaLinux_DISTRO_VERSION_MAJOR\"><phrase>$$DISTRO_VERSION_MAJOR</phrase></para>" >>$(TMPPARDOC) ; \ | ||
243 | echo "<para id=\"EneaLinux_DISTRO_VERSION_MINOR\"><phrase>$$DISTRO_VERSION_MINOR</phrase></para>" >>$(TMPPARDOC) ; \ | ||
244 | echo "</section>" >>$(TMPPARDOC) | ||
245 | |||
246 | # **************************************************************************** | ||