From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 385635ABA for ; Thu, 19 Mar 2015 12:24:12 +0100 (CET) Received: by wgdm6 with SMTP id m6so59523019wgd.2 for ; Thu, 19 Mar 2015 04:24:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jo1XNbm/L///bx0wocD3XToCjZGKZLBiUUJxvsBi64k=; b=kwhcQh4bLZza3BaLlVQtvJh7RhA1SvGQunIZPLif5tycCkGtkOqtAMGPKBfgn4S8uv 0n//VXwvFswcplANZE2hrY3AXFY//H3PvAuBjm/00mZbDcWPPrED9Zmbcdb+pHqLkRfn iixJQI1AKVBin0sXKuK/V/XcPbjE5EX4/YcF7FvxZk27XvcGOko0TV1EFD74R9++wha3 EIXhb7aaTx1BKSAx1M9hzrZZAewuxMB1bF0cHDs17q5ovOSCBiszEguG0bKKFQkQ85tl hmtKdco8vHVh7vEzn6G31ozFkPVfvU/x4IS9VuB0WLmtLLJPW04YXJYzQowlWh5PPcY4 e6Vg== X-Gm-Message-State: ALoCoQmTtaS8CsfLGhElOl9+5YgzaE7n+i3fMPFFpyzGfxAFJ7nQZCNhjIiqYV+/nyxky0ht5sTy X-Received: by 10.194.21.193 with SMTP id x1mr148938787wje.144.1426764252005; Thu, 19 Mar 2015 04:24:12 -0700 (PDT) Received: from localhost.localdomain (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id y14sm1537682wjr.39.2015.03.19.04.24.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 04:24:11 -0700 (PDT) From: Thomas Monjalon To: john.mcnamara@intel.com Date: Thu, 19 Mar 2015 12:23:21 +0100 Message-Id: <1426764204-3882-5-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1426764204-3882-1-git-send-email-thomas.monjalon@6wind.com> References: <1422972678-7982-1-git-send-email-john.mcnamara@intel.com> <1426764204-3882-1-git-send-email-thomas.monjalon@6wind.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v5 4/7] doc: add pdf output 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: Thu, 19 Mar 2015 11:24:12 -0000 From: John McNamara Add make system support for building PDF versions of the guides. Requires Python Sphinx and TexLive Full. Signed-off-by: John McNamara Signed-off-by: Thomas Monjalon --- doc/guides/conf.py | 13 +++++++++++-- mk/rte.sdkdoc.mk | 46 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/doc/guides/conf.py b/doc/guides/conf.py index fba34a6..264b0cd 100644 --- a/doc/guides/conf.py +++ b/doc/guides/conf.py @@ -1,5 +1,5 @@ # BSD LICENSE -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,6 +34,15 @@ project = 'DPDK' html_show_copyright = False -version = subprocess.check_output(["make","-sRrC","../../", "showversion"]) +version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion']) +release = version master_doc = 'index' + +latex_documents = [ + ('index', + 'doc.tex', + '', + '', + 'manual') +] diff --git a/mk/rte.sdkdoc.mk b/mk/rte.sdkdoc.mk index dabc0d6..5b44083 100644 --- a/mk/rte.sdkdoc.mk +++ b/mk/rte.sdkdoc.mk @@ -1,7 +1,7 @@ # BSD LICENSE # -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. -# Copyright(c) 2013 6WIND S.A. +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. +# Copyright(c) 2013-2015 6WIND S.A. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -37,23 +37,33 @@ endif endif RTE_SPHINX_BUILD = sphinx-build +RTE_PDFLATEX_VERBOSE := --interaction=nonstopmode + ifndef V RTE_SPHINX_VERBOSE := -q +RTE_PDFLATEX_VERBOSE := --interaction=batchmode +RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1 endif ifeq '$V' '0' RTE_SPHINX_VERBOSE := -q +RTE_PDFLATEX_VERBOSE := --interaction=batchmode +RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1 endif +RTE_PDF_DPI ?= 300 + +RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/)) + .PHONY: help help: @cat $(RTE_SDK)/doc/build-sdk-quick.txt @$(MAKE) -rR showconfigs | sed 's,^,\t\t\t\t,' .PHONY: all -all: api-html guides-html +all: api-html guides-html guides-pdf .PHONY: clean -clean: api-html-clean guides-html-clean +clean: api-html-clean guides-html-clean guides-pdf-clean .PHONY: api-html api-html: api-html-clean @@ -79,7 +89,31 @@ guides-%-clean: $(Q)rm -rf $(RTE_OUTPUT)/doc/$*/guides $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/$* 2>&- || true +guides-pdf-clean: guides-pdf-img-clean +guides-pdf-img-clean: + $(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf + +guides-pdf: $(addprefix guides-pdf-, $(notdir $(RTE_GUIDES:/=))) ; guides-%: - @echo 'sphinx for guides...' + @echo 'sphinx processing $@...' $(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \ - -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides $(RTE_OUTPUT)/doc/$*/guides + -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides \ + $(RTE_OUTPUT)/doc/$*/guides + +guides-pdf-%: + @echo 'sphinx processing $@...' + $(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \ + -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides/$* \ + $(RTE_OUTPUT)/doc/pdf/guides/$* + $(Q)rm -f $^ + @echo 'pdflatex processing $@...' + $(Q)$(MAKE) all-pdf -sC $(RTE_OUTPUT)/doc/pdf/guides/$* \ + LATEXOPTS=$(RTE_PDFLATEX_VERBOSE) + $(Q)mv $(RTE_OUTPUT)/doc/pdf/guides/$*/doc.pdf \ + $(RTE_OUTPUT)/doc/pdf/guides/$*.pdf + +# Each PDF depends on generated images *.pdf from *.svg +$(foreach guide, $(RTE_GUIDES), $(foreach img, $(wildcard $(guide)img/*.svg), \ + $(eval guides-pdf-$(notdir $(guide:/=)): $(img:svg=pdf)))) +%.pdf: %.svg + $(Q)inkscape -d $(RTE_PDF_DPI) -D -f $< -A $@ $(RTE_INKSCAPE_VERBOSE) -- 2.2.2