From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by dpdk.org (Postfix) with ESMTP id 9B7B54C95
 for <dev@dpdk.org>; Tue, 11 Sep 2018 18:13:42 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 11 Sep 2018 09:13:34 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.53,361,1531810800"; d="scan'208";a="89520639"
Received: from silpixa00399126.ir.intel.com (HELO
 silpixa00399126.ger.corp.intel.com) ([10.237.223.223])
 by orsmga001.jf.intel.com with ESMTP; 11 Sep 2018 09:13:33 -0700
From: Bruce Richardson <bruce.richardson@intel.com>
To: bluca@debian.org
Cc: dev@dpdk.org,
	Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 11 Sep 2018 17:13:22 +0100
Message-Id: <20180911161322.20114-1-bruce.richardson@intel.com>
X-Mailer: git-send-email 2.17.1
Subject: [dpdk-dev] [PATCH] doc: support building HTML guides with meson
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 11 Sep 2018 16:13:43 -0000

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
NOTE: this patch depends upon:
http://patches.dpdk.org/project/dpdk/list/?series=1232

 doc/api/meson.build    |  3 ++-
 doc/guides/meson.build | 16 ++++++++++++++++
 doc/meson.build        | 11 +++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/meson.build

diff --git a/doc/api/meson.build b/doc/api/meson.build
index 5dfa0fe04..f9bee4dac 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -50,5 +50,6 @@ if doxygen.found()
 		install_dir: htmldir,
 		build_by_default: false)
 
-	run_target('doc', command: 'true', depends: doxy_build)
+	doc_targets += doxy_build
+	doc_target_names += 'Doxygen_API'
 endif
diff --git a/doc/guides/meson.build b/doc/guides/meson.build
new file mode 100644
index 000000000..6d1e2990d
--- /dev/null
+++ b/doc/guides/meson.build
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2017 Intel Corporation
+
+sphinx = find_program('sphinx-build', required: get_option('enable_docs'))
+
+if sphinx.found()
+	html_guides_build = custom_target('html_guides_build',
+		input: meson.current_source_dir(),
+		output: 'index.html',
+		command: [sphinx, '-b', 'html', '@INPUT@', meson.current_build_dir() + '/html'],
+		build_by_default: false,
+		install: get_option('enable_docs'))
+
+	doc_targets += html_guides_build
+	doc_target_names += 'HTML_Guides'
+endif
diff --git a/doc/meson.build b/doc/meson.build
index afca2e713..c5410d85d 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,4 +1,15 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+doc_targets = []
+doc_target_names = []
 subdir('api')
+subdir('guides')
+
+if doc_targets.length() == 0
+	message = 'No docs targets found'
+else
+	message = 'Building docs:'
+endif
+run_target('doc', command: ['echo', message, doc_target_names],
+	depends: doc_targets)
-- 
2.11.0