summaryrefslogtreecommitdiffstats
path: root/doc/Makefile
diff options
context:
space:
mode:
authorLennart Johansson <lennart.johansson@enea.com>2016-06-02 13:41:04 +0200
committerLennart Johansson <lennart.johansson@enea.com>2016-06-02 13:41:04 +0200
commit70919fc0a582f58aeac67863f5e0f5c232613f72 (patch)
tree6ca479c08be2d3449d361418f94dc83c83deb7d1 /doc/Makefile
parent236463c519085d87a3096d6171f3e92d9b68db00 (diff)
downloadel_manifests-standard-70919fc0a582f58aeac67863f5e0f5c232613f72.tar.gz
Doc Add autovariables from manifest, poky.ent, enea.conf
Add autovariable from manifest repository name, e.g. the profile name Add autovariables from poky.ent, e.g. Yocto version etc.. in pardoc-distro Add autovariables from enea.conf e.g. release MAJOR MINOR via generated s_docsrc_common/pardoc-distro and also pick up MAJOR MINOR into the make system to create BOOK_VER => BL_LABEL on books Add autocreate build_boot chapter in release info from the README files in all included targets Adapt book XML files to the above Currently this makes the Makefile and init scripts identical in different el6-<profile>.git All are now automatic: Just clone el6-xxxx.git and cd el6-xxx/doc ; make doc and all are done until the books are built and ready. It takes several minutes to autofetch all from git using the repo command according to the target manifests before the books start to build. Rebuilding books are quick. Signed-off-by: Lennart Johansson <lennart.johansson@enea.com>
Diffstat (limited to 'doc/Makefile')
-rw-r--r--doc/Makefile60
1 files changed, 40 insertions, 20 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 7fd9b52..59d25d5 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -20,8 +20,10 @@ TARGETDEFAULTXMLS := $(shell cd $(REPODIR); ls -1 */default.xml)
20# 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
21CURRENTHASH := $(shell git log -1 --pretty=format:%H 2>/dev/null) 21CURRENTHASH := $(shell git log -1 --pretty=format:%H 2>/dev/null)
22CURRENTURL := $(shell git remote show origin | sed -n '/Fetch URL: /s/^.*URL: //p' 2>/dev/null) 22CURRENTURL := $(shell git remote show origin | sed -n '/Fetch URL: /s/^.*URL: //p' 2>/dev/null)
23.PHONY: inittargets 23
24# ****************************************************************** 24# ******************* AutoGenerated chapter from template and target READMEs *******
25BUILDBOOT_XML := book-enea-linux-release-info/doc/build_boot_generated.xml
26BUILDBOOT_TEMPLATE := book-enea-linux-release-info/doc/build_boot_template.xml
25 27
26 28
27 29
@@ -38,11 +40,10 @@ DOCBOOK_FO_USEFOP ?= yes
38DOCBOOK_TO_BOOKDIR ?= yes 40DOCBOOK_TO_BOOKDIR ?= yes
39DOCBOOK_CLEANTMP ?= yes 41DOCBOOK_CLEANTMP ?= yes
40 42
41#Components in this subsystem 43#Components (books) in this subsystem
42COMPONENTS := book-enea-linux-release-info book-enea-linux-open-source 44# COMPONENTS := book-enea-linux-release-info book-enea-linux-open-source
43# COMPONENTS += book-enea-linux-eclipse-open-source 45# COMPONENTS += book-enea-linux-eclipse-open-source
44# COMPONENTS += book-enea-linux-target-guide 46COMPONENTS := $(shell ls -d book-enea* )
45
46 47
47# -------------------------------------------------------------- 48# --------------------------------------------------------------
48ifeq ($(VERBOSE),yes) 49ifeq ($(VERBOSE),yes)
@@ -65,24 +66,23 @@ VALIDATE = no
65# Export all parameters including those on the command line 66# Export all parameters including those on the command line
66export 67export
67 68
68.PHONY: doc books docusage 69.PHONY: doc books docusage init initbuild inittargets initpardoc initbuildboot
69 70
70 71
71docusage: 72docusage:
72 @echo 'make docusage #Shows this help text' 73 @echo 'make docusage #Shows this help text'
73 @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'
74 @echo 'make doc #Builds the userdoc, does autoinit if needed' 75 @echo 'make doc #Builds the userdoc, does autoinit if needed'
75 @echo 'make init #Init all needed s_* below' 76 @echo 'make init #Init all needed init* below'
76 @echo 'make initbuild #Init s_docbuild Docbook build system and central files' 77 @echo 'make initbuild #Init s_docbuild Docbook build system and central files'
77 @echo 'make inittargets #Init s_targets using repo tool Targets in this distro with poky' 78 @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/' 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'
79 @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/'
80 @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'
81 @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'
82 @echo #Force rebuilding (ignore dependency on file times or BL_LABEL)'
83 @echo ' # Dependency only works if common doc directory is kept'
84 @echo 'make pullbuild #git pull in s_docbuild' 84 @echo 'make pullbuild #git pull in s_docbuild'
85 @echo 'make pulltargets #git pull in s_targets' 85 @echo 'make pulltargets #git pull in s_targets. You need also initpardoc initbuildboot'
86 @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'
87 @echo '' 87 @echo ''
88 @echo 'Optional parameters for make doc:' 88 @echo 'Optional parameters for make doc:'
@@ -105,7 +105,7 @@ docusage:
105 @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)'
106 @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'
107 @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:'
108 @echo ' $(DOCBOOKOLINKDB_BASE)_*.db' 108 @echo ' $(DOCBOOKOLINKDB_BASE)_*.db'
109 @echo ' Typical examples:' 109 @echo ' Typical examples:'
110 @echo ' make doc Creates all books, all formats' 110 @echo ' make doc Creates all books, all formats'
111 @echo ' make doc COMP=book-xxxx FORMAT=html' 111 @echo ' make doc COMP=book-xxxx FORMAT=html'
@@ -124,7 +124,8 @@ ifeq ($(DOCBOOK_TOOLS_VERSIONS),yes)
124 $(VERB)$(MAKE) -f $(DOCBOOKMAKE)/tools_book_standalone.mk book_tools_versions 124 $(VERB)$(MAKE) -f $(DOCBOOKMAKE)/tools_book_standalone.mk book_tools_versions
125endif 125endif
126 126
127init: initbuild inittargets initpardoc 127# We rely on make doing these in order left to right
128init: initbuild inittargets initpardoc initbuildboot
128pullall: pullbuild pulltargets 129pullall: pullbuild pulltargets
129 130
130# If no COMP, iterate over books-* in COMPONENTS with make doc 131# If no COMP, iterate over books-* in COMPONENTS with make doc
@@ -150,7 +151,7 @@ FORMAT=html pdf eclipse
150endif 151endif
151 152
152 153
153books: initbuild inittargets initpardoc 154books: init
154# BOOKPACKAGES is defined in all book-*/swcomp.mk 155# BOOKPACKAGES is defined in all book-*/swcomp.mk
155 $(VERB)DISTRO_VERSION_MAJOR=`egrep '"EneaLinux_DISTRO_VERSION_MAJOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \ 156 $(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 DISTRO_VERSION_MINOR=`egrep '"EneaLinux_DISTRO_VERSION_MINOR"' s_docsrc_common/pardoc-distro.xml | sed 's/.*<phrase>//;s/<\/phrase>.*//'` ; \
@@ -169,8 +170,8 @@ ifeq ($(DOCBOOK_CLEANTMP),yes)
169endif 170endif
170endif 171endif
171 172
172# cleaninit cleans ALL tmpcommon and all s_* 173# cleaninit cleans ALL tmpcommon and all s_* and generated build_boot chapter xml
173clean: cleaninit 174clean: cleaninit cleanbuildboot
174 $(VERB)rm -rf doc tmp 2>/dev/null 175 $(VERB)rm -rf doc tmp 2>/dev/null
175ifneq ($(filter book-%, $(COMPONENTS)),) 176ifneq ($(filter book-%, $(COMPONENTS)),)
176 $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ 177 $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \
@@ -214,12 +215,12 @@ $(TMPCLONEROOT_TARGETS):
214 215
215# **************************************************************************** 216# ****************************************************************************
216# ******************** SUPPORT FOR dynamic pardoc with added parameters ****** 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
217 219
218PATH_DOCSRC_COMMON = $(SUBSYSROOT)/s_docsrc_common 220PATH_DOCSRC_COMMON = $(SUBSYSROOT)/s_docsrc_common
219NAME_DOCSRC_COMMON = docsrc_common 221NAME_DOCSRC_COMMON = docsrc_common
220TMPCLONEROOT_DOCSRC_COMMON := $(TMPCLONEROOT)/$(NAME_DOCSRC_COMMON) 222TMPCLONEROOT_DOCSRC_COMMON := $(TMPCLONEROOT)/$(NAME_DOCSRC_COMMON)
221TMPPARDOC := $(TMPCLONEROOT_DOCSRC_COMMON)/pardoc-distro.xml 223TMPPARDOC := $(TMPCLONEROOT_DOCSRC_COMMON)/pardoc-distro.xml
222.PHONY: initpardoc
223 224
224initpardoc: s_docsrc_common 225initpardoc: s_docsrc_common
225 226
@@ -233,14 +234,33 @@ $(TMPCLONEROOT_DOCSRC_COMMON): s_targets
233 $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi 234 $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi
234 $(VERB)if [ ! -d $(TMPCLONEROOT_DOCSRC_COMMON) ]; then mkdir -p $(TMPCLONEROOT_DOCSRC_COMMON) ; fi 235 $(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 @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 $(VERB)FIRSTTARGET=`ls -1 s_targets/ | head -1`; \
237 ENEACONF=s_targets/$$FIRSTTARGET/poky/meta-el-common/conf/distro/enea.conf ; \ 238 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_MAJOR=`egrep '^DISTRO_VERSION_MAJOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \
239 DISTRO_VERSION_MINOR=`egrep '^DISTRO_VERSION_MINOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ 240 DISTRO_VERSION_MINOR=`egrep '^DISTRO_VERSION_MINOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \
240 cat docsrc_common/pardoc-distro.xml | sed '/<\/section>/d' | \ 241 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 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) ; \
242 echo "<para id=\"EneaLinux_DISTRO_VERSION_MAJOR\"><phrase>$$DISTRO_VERSION_MAJOR</phrase></para>" >>$(TMPPARDOC) ; \ 244 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) ; \ 245 echo "<para id=\"EneaLinux_DISTRO_VERSION_MINOR\"><phrase>$$DISTRO_VERSION_MINOR</phrase></para>" >>$(TMPPARDOC) ; \
244 echo "</section>" >>$(TMPPARDOC) 246 echo "</section>" >>$(TMPPARDOC)
245 247
246# **************************************************************************** 248# ****************************************************************************
249# ***** Create XML chapter with build/boot commands from all README files in s_targets
250
251initbuildboot: $(BUILDBOOT_XML)
252
253cleanbuildboot:
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# ****************************************************************************