From da05e9b9d3484d072a50be6237b0e9917ea04c7b Mon Sep 17 00:00:00 2001 From: Lennart Johansson Date: Fri, 3 Jun 2016 12:45:00 +0200 Subject: Doc Add make dist to autostore books to distrib doc/ Add to Makefile: "make dist BOOK_DIST_DIR=storeto/doc" to both build all and copy built books to storeto/doc which simplifies for release build scripts. This way the release build script does not need to know which books are built, but just includes doc/ in the release. make dist can currently not be combined with BOOK_BUILD_DIR or with DOCBOOK_TO_BOOKDIR=no because it copies results from the expected default place Signed-off-by: Lennart Johansson --- doc/Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 59d25d5..878874b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -66,13 +66,15 @@ VALIDATE = no # Export all parameters including those on the command line export -.PHONY: doc books docusage init initbuild inittargets initpardoc initbuildboot +.PHONY: doc books docusage init initbuild inittargets initpardoc initbuildboot dist 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, does autoinit if needed' + @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, does autoinit if needed' + @echo 'make dist BOOK_DIST_DIR=xx/doc #Builds all and copies results to BOOK_DIST_DIR' + @echo ' #Does not work with DOCBOOK_TO_BOOKDIR or BOOK_BUILD_DIR' @echo 'make init #Init all needed init* below' @echo 'make initbuild #Init s_docbuild Docbook build system and central files' @echo 'make inittargets #Init s_targets using repo tool Targets in this distro with poky' @@ -144,6 +146,17 @@ doc: books @# endif +dist: doc + @echo "Copying resulting built documents to $(BOOK_DIST_DIR)" + $(VERB)if [ "$(BOOK_DIST_DIR)" = "" ]; then echo "ERROR: Missing BOOK_DIST_DIR parameter, typically shall be xxx/doc"; exit 10; fi + $(VERB)if [ ! -d "`dirname $(BOOK_DIST_DIR)`" ]; then echo "ERROR: Missing parent for BOOK_DIST_DIR"; exit 10; fi + $(VERB)if [ -f "$(BOOK_DIST_DIR)/Makefile" ]; then echo "ERROR: Wrong BOOK_DIST_DIR, contains a Makefile?"; exit 10; fi + $(VERB)if [ ! -d "$(BOOK_DIST_DIR)" ]; then mkdir -p "$(BOOK_DIST_DIR)/pdf" ; fi + $(VERB)for book in $(COMPONENTS); do \ + if ls -d $$book/book*.pdf >/dev/null 2>&1; then cp --preserve=timestamps $$book/book*.pdf "$(BOOK_DIST_DIR)/pdf" ; fi ; \ + if ls -d $$book/html >/dev/null 2>&1; then cp -r --preserve=timestamps $$book/html "$(BOOK_DIST_DIR)" ; fi ; \ + if ls -d $$book/eclipse >/dev/null 2>&1; then cp -r --preserve=timestamps $$book/eclipse "$(BOOK_DIST_DIR)" ; fi ; \ + done # Default FORMATs ifeq ($(FORMAT),) -- cgit v1.2.3-54-g00ecf