[spp] [PATCH v2 09/13] makefile: fix bug of PDF compilation

ogawa.yasufumi at lab.ntt.co.jp ogawa.yasufumi at lab.ntt.co.jp
Wed Sep 26 11:08:37 CEST 2018


From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>

This patch includes bug fix and refactor of Makefile.

In target 'doc-pdf', PDF images embedded into the document is removed
immediately after sphinx command is executed. However, it possibly
remove PDF images before sphinx refers them. It is resulted in a
failure of file not found.
To fix the bug, move removing PDF images from 'doc-pdf' to 'doc-clean'
to avoid the error.

For refactoring, remove 'compile-doc.sh' for running Makefile in
'docs/guides' directory and do the task from project root Makefile.
'compile-doc.sh' is no needed any more.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 Makefile                   | 11 +++++++----
 docs/guides/compile-doc.sh | 11 -----------
 2 files changed, 7 insertions(+), 15 deletions(-)
 delete mode 100644 docs/guides/compile-doc.sh

diff --git a/Makefile b/Makefile
index 6d29dcc..47fa4cb 100644
--- a/Makefile
+++ b/Makefile
@@ -47,17 +47,20 @@ include $(RTE_SDK)/mk/rte.extsubdir.mk
 DOC_ROOT = docs/guides
 
 # Compile RST documents
+.PHONY: doc-pdf
+doc-all: doc-pdf doc-html
+
 .PHONY: doc-html
 doc-html:
-	sh $(DOC_ROOT)/compile-doc.sh doc-html
+	make -C $(DOC_ROOT) html
 
 .PHONY: doc-pdf
 doc-pdf:
 	python $(DOC_ROOT)/gen_pdf_imgs.py
-	sh $(DOC_ROOT)/compile-doc.sh doc-pdf
-	find $(DOC_ROOT)/images/ -type f -name "*.pdf" -delete
+	make -C $(DOC_ROOT) latexpdf
 	@echo "Succeeded to generate '$(DOC_ROOT)/_build/latex/SoftPatchPanel.pdf'"
 
 .PHONY: doc-clean
 doc-clean:
-	sh $(DOC_ROOT)/compile-doc.sh clean
+	find $(DOC_ROOT)/images/ -type f -name "*.pdf" -delete
+	make -C $(DOC_ROOT) clean
diff --git a/docs/guides/compile-doc.sh b/docs/guides/compile-doc.sh
deleted file mode 100644
index 237c526..0000000
--- a/docs/guides/compile-doc.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-cd `dirname ${0}`
-
-if [ $1 = 'doc-html' ]; then
-	make html
-elif [ $1 = 'doc-pdf' ]; then
-	make latexpdf
-elif [ $1 = 'clean' ]; then
-	make clean
-fi
-- 
2.7.4



More information about the spp mailing list