#Path to this subsystem's root directory SUBSYSROOT := $(shell pwd) #Path to the directory under which both documentation and docbuild repos shall be cloned CLONEROOT := $(dir $(abspath $(dir $(SUBSYSROOT)))) #Path to each required git clone CLONE_DOCBUILD = $(CLONEROOT)docbuild CLONE_DOC = $(CLONEROOT)documentation CLONE_CUSTOM = $(CLONEROOT)meta-enea-base-ppc #Git repositories to be cloned REPO_DOCBUILD = build/docbuild.git REPO_DOC = linux/documentation.git ## THIS clone REPO_CUSTOM = linux/meta-enea-base-ppc.git #Test if required clones exist ifeq ($(wildcard $(CLONE_DOCBUILD)),) $(error Cannot find expected clone of $(REPO_DOCBUILD) in $(CLONE_DOCBUILD)) endif ifeq ($(wildcard $(CLONE_DOC)),) $(error Cannot find expected clone of $(REPO_DOC) in $(CLONE_DOC)) endif ifeq ($(wildcard $(CLONE_CUSTOM)),) $(error Cannot find expected clone of $(REPO_CUSTOM) in $(CLONE_CUSTOM)) endif #Path to DocBook make files and templates DOCBOOKMAKE = $(CLONE_DOCBUILD)/docmake DOCBOOKTEMPLATE = $(CLONE_DOCBUILD)/template #Path to the OLINK database including leading part of file name (will add -$(FORMAT).db) DOCBOOKOLINKDB_BASE = $(CLONE_CUSTOM)/documentation/olinkdb/olink-targetdb-master DOCBOOK_OLINKS ?= yes #Components in this subsystem COMPONENTS := book-enea-linux-users-guide book-enea-linux-release-info book-enea-linux-open-source #Release version, used in labels and text REL_VER_EXT := $(shell perl -e \ 'while(<>) {\ if (//) { print $$1 ; exit; }\ }' \ < $(CLONE_CUSTOM)/documentation/docsrc_common/pardoc-distro.xml 2>/dev/null) #$(info REL_VER_EXT = $(REL_VER_EXT)) ifneq ($(REL_VER_EXT),) REL_VER ?= $(REL_VER_EXT) else REL_VER ?= undefined endif $(info REL_VER = $(REL_VER)) # ----------------------------------------------------- # Standalone builds DOCBOOK_FO_USEFOP ?= yes DOCBOOK_TO_BOOKDIR ?= yes # -------------------------------------------------------------- ifeq ($(VERBOSE),yes) VERB := else VERB := @ endif MAKEFLAGS += --no-print-directory MAKEFLAGS += --directory $(SUBSYSROOT) MAKEFLAGS += --no-builtin-rules --no-builting-variables # Skip xml validation to make it possible to include xml files with unresolved # links from book-enea-linux-users-guide VALIDATE = no # BL_LABEL is either given on make command line or using BOOK_VER or defaults to a timestamp # Export all parameters including those on the command line export .PHONY: doc books docusage docusage: @echo 'make docusage #Shows this help text' @echo ' DOCBOOK_TOOLS_VERSIONS=yes #Displays DocBook tools versions in this machine' @echo 'make doc #Builds the userdoc' @echo 'The following directories must be cloned into the same directory before running make doc:' @echo ' docbuild #Clone of repo $(REPO_DOCBUILD)' @echo ' documentation #Clone of repo $(REPO_DOC)' @echo ' meta-enea-base-ppc #Clone of repo $(REPO_CUSTOM) (build GA PPC userdoc from THIS clone)' @echo 'Optional parameters for make doc:' @echo ' COMP= #Component (book) to build. Book component names are book-*' @echo ' #Default component/s:' @echo ' $(COMPONENTS)' @echo ' FORMAT= #One of: pdf, html, or eclipse (Default all are built)' @echo ' BL_LABEL= #Becomes footer in book (default: date + time)' @echo ' DOCBOOK_TO_BOOKDIR=no #(default yes) Avoid moving result to book directory' @echo ' # and avoid erasing common doc and tmp directories' @echo ' BOOKFORCE=yes #Force rebuilding (ignore dependency on file times or BL_LABEL)' @echo ' # Dependency only works if common doc directory is kept' @echo ' BOOKCONDITION="xx;yy;.." #Include XML elements with condition any of xx or yy' @echo ' # (if rebuilding, BOOKFORCE=yes may be needed)' @echo ' # Empty=only default. none=none, all=everything.' @echo ' BOOKDEFAULTCONDITION #Default conditions, if no BOOKCONDITION. Used in book-*/swcomp.mk' @echo ' SHOW_COMMENTS=yes #For proofread. Unhide .. comments Only PDF' @echo ' BOOKVERBOSE=yes #Verbose info building books' @echo ' DOCBOOK_OLINKS=no #Avoid the olink database in Makefile (in book not using it)' @echo ' DOCBOOK_OLINK_TARGETDB=only #Build a target db for this book (for links into it)' @echo ' DOCBOOK_OLINK_TARGETDB=yes #Build a target db AND build the book' @echo ' #Master olinkdb defined in this Makefile, one per generated format, is:' @echo ' $(DOCBOOKOLINKDB_BASE)_*.db' @echo ' Typical examples:' @echo ' make doc Creates all books, all formats' @echo ' make doc COMP=book-xxxx FORMAT=html' @echo ' make doc COMP=book-xxxx FORMAT=pdf' @echo ' make doc BL_LABEL="Version 1.2.3" Creates all with version in footers and front' @echo ' Requires docbook-xsl-1.76.1 or later, docbook-xml 4.2, svg1.1, fop-1.0 + fop-hyph.jar' @echo ' fop + the separate fop-hyph can be found together in package "libfop-java"' @echo ' otherwise fetch fop-hyph.jar and place in same place as fop.jar' @echo ' Requires libxml2-2.7.8 or later, libxslt-1.1.26 or later' @echo ' Requires java machine to run fop (creating PDF). jar for optional FORMAT=eclipse' @echo ' Without jar, the optional EclipseHelp format can not be built' @echo ' tools_book_standalone.mk => libxml2, libxslt, and fop (and to catalog-el.xml)' @echo ' catalog-el.xml => svg, docbook-xml, docbook-xsl' ifeq ($(DOCBOOK_TOOLS_VERSIONS),yes) $(VERB)$(MAKE) -f $(DOCBOOKMAKE)/tools_book_standalone.mk book_tools_versions endif # If no COMP, iterate over books-* in COMPONENTS with make doc ifeq ($(COMP),) doc: ifneq ($(filter book-%, $(COMPONENTS)),) $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ $(MAKE) doc COMP=$$comp; \ done endif else ifneq ($(wildcard $(SUBSYSROOT)/docsrc_common/conditions.mk),) include $(SUBSYSROOT)/docsrc_common/conditions.mk endif include $(SUBSYSROOT)/$(COMP)/swcomp.mk doc: books @# endif # Default FORMATs ifeq ($(FORMAT),) FORMAT=html pdf eclipse endif books: # BOOKPACKAGES is defined in all book-*/swcomp.mk $(VERB)for book in $(BOOKPACKAGES); do \ for format in $(FORMAT); do \ $(MAKE) -f $(DOCBOOKMAKE)/make_docbook_standalone.mk BOOK=$$book FORMAT=$$format books || exit 10; \ done ; \ done ifeq ($(DOCBOOK_TO_BOOKDIR),yes) $(VERB)rm -rf doc tmp endif clean: $(VERB)rm -rf doc tmp 2>/dev/null ifneq ($(filter book-%, $(COMPONENTS)),) $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ rm -rf $$comp/book*.pdf $$comp/html $$comp/eclipse 2>/dev/null; \ done endif