From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id F2A2B5AAE for ; Fri, 30 Jan 2015 19:14:18 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 30 Jan 2015 10:09:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="447650776" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jan 2015 09:59:47 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t0UIDdOA000939; Fri, 30 Jan 2015 18:13:39 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t0UIDdkQ008567; Fri, 30 Jan 2015 18:13:39 GMT Received: (from jmcnam2x@localhost) by sivswdev02.ir.intel.com with id t0UIDduO008563; Fri, 30 Jan 2015 18:13:39 GMT From: John McNamara To: dev@dpdk.org Date: Fri, 30 Jan 2015 18:13:25 +0000 Message-Id: <1422641608-8514-2-git-send-email-john.mcnamara@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1422641608-8514-1-git-send-email-john.mcnamara@intel.com> References: <1421255657-19521-1-git-send-email-john.mcnamara@intel.com> <1422641608-8514-1-git-send-email-john.mcnamara@intel.com> Subject: [dpdk-dev] [PATCH v2 1/4] mk: Add 'make doc-pdf' target to convert guide docs to pdf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2015 18:14:19 -0000 Added make system support for building PDF versions of the guides. Requires Python Sphinx and TexLive Full. Signed-off-by: John McNamara --- mk/rte.sdkdoc.mk | 33 ++++++++++++++++++++++++++++++++- mk/rte.sdkroot.mk | 3 ++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/mk/rte.sdkdoc.mk b/mk/rte.sdkdoc.mk index dabc0d6..fb90d41 100644 --- a/mk/rte.sdkdoc.mk +++ b/mk/rte.sdkdoc.mk @@ -39,11 +39,15 @@ endif RTE_SPHINX_BUILD = sphinx-build ifndef V RTE_SPHINX_VERBOSE := -q +RTE_PDFLATEX_VERBOSE := > /dev/null 2>&1 endif ifeq '$V' '0' RTE_SPHINX_VERBOSE := -q +RTE_PDFLATEX_VERBOSE := > /dev/null 2>&1 endif +DEFAULT_DPI ?= 300 + .PHONY: help help: @cat $(RTE_SDK)/doc/build-sdk-quick.txt @@ -53,7 +57,7 @@ help: all: api-html guides-html .PHONY: clean -clean: api-html-clean guides-html-clean +clean: api-html-clean guides-html-clean guides-latex-clean .PHONY: api-html api-html: api-html-clean @@ -83,3 +87,30 @@ guides-%: @echo 'sphinx for guides...' $(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \ -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides $(RTE_OUTPUT)/doc/$*/guides + +pdf: pdf-rel_notes pdf-linux_gsg pdf-freebsd_gsg pdf-prog_guide \ + pdf-sample_app_ug pdf-testpmd_app_ug + +pdf-%: + @echo 'creating' $* 'pdf ...' + # Generate the latex files. + $(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \ + -c $(RTE_SDK)/doc/guides/$* $(RTE_SDK)/doc/guides/$* \ + $(RTE_OUTPUT)/doc/latex/guides/$* + + # Convert the svg files to png. + $(eval svg_files=$(notdir $(wildcard $(RTE_SDK)/doc/guides/$*/img/*.svg))) + $(eval svg_files=$(patsubst %.svg, %, $(svg_files))) + @for svg in $(svg_files); do \ + inkscape -d $(DEFAULT_DPI) -D -b ffffff \ + -f $(RTE_SDK)/doc/guides/$*/img/$$svg.svg \ + -e $(RTE_OUTPUT)/doc/latex/guides/$*/$$svg.png \ + $(RTE_PDFLATEX_VERBOSE); \ + done + + # Change the svg image includes to png in the latex docs. + $(Q)sed -i 's/\.svg/.png/g' $(RTE_OUTPUT)/doc/latex/guides/$*/*.tex + + # Convert the latex to pdf. + $(Q)$(MAKE) -C $(RTE_OUTPUT)/doc/latex/guides/$* \ + all-pdf $(RTE_PDFLATEX_VERBOSE) diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk index e8423b0..68931bb 100644 --- a/mk/rte.sdkroot.mk +++ b/mk/rte.sdkroot.mk @@ -101,9 +101,10 @@ testall: install uninstall: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@ -.PHONY: doc help +.PHONY: doc help pdf doc: doc-all help: doc-help +pdf: doc-pdf doc-%: $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkdoc.mk $* -- 1.7.4.1