From patchwork Sun Sep 7 23:39:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 386758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 415451400B7 for ; Mon, 8 Sep 2014 09:40:23 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 78AB590E6E; Sun, 7 Sep 2014 23:40:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aQxh1EHJuEHe; Sun, 7 Sep 2014 23:40:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7668590F2F; Sun, 7 Sep 2014 23:39:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 81DD51C2456 for ; Sun, 7 Sep 2014 23:39:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7E665A0B6D for ; Sun, 7 Sep 2014 23:39:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V8qYeGls8y3x for ; Sun, 7 Sep 2014 23:39:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 952A9A08DB for ; Sun, 7 Sep 2014 23:39:40 +0000 (UTC) Received: by mail-wg0-f41.google.com with SMTP id l18so13979165wgh.0 for ; Sun, 07 Sep 2014 16:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Zu5sTqt9F05ogMLwxxeFNWsG0gtZWJQ90eqmpLEuLCA=; b=t/LOM4jQkUx4S/UJHfcfZpGZO5bphfTTsm6Yp3f20tc0wkfhdDndioppbLsd4pms+C mnjM89cUkiQs8eD6+nR/KuA/BdTx9kxaxTkQ2SLJqpAAW8UdmKFwFhVsDjYhalkoA3DU 887yCKqxBu4wRUvOBk1sE3RjvdKydqyNuPBrTc3xIe2fAeHg3nZwEEfgywvkWxGIG7pu Z3cMFFQptgGq+fDzVBdh60mgbYU9plHmj9HfkG3CuEIjDXBK/P42CnHcrJcdlPz71Axr OKtLzVmEKuaNuaqzXLRa+65ujJe9o9lJ7dreYo6oHIFJOc/6mQHHMgBg7fUe39RF15qM KMtg== X-Received: by 10.194.95.66 with SMTP id di2mr29537553wjb.47.1410133178947; Sun, 07 Sep 2014 16:39:38 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id c7sm9900243wib.12.2014.09.07.16.39.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Sep 2014 16:39:38 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Mon, 8 Sep 2014 01:39:14 +0200 Message-Id: <05dca7f844f35041c1203e36a8adc878d22804f0.1410132603.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 15/18 v4] docs/manual: allow documents to define some hooks, as for a package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Allow documents to define two hooks: - DOC_EXTRA_CHECK_DEPENDENCIES to check for extra dependencies required by this document - DOC_EXTRA_CHECK_DEPENDENCIES_FMT ditto, but for the specific format - DOC_POST_EXTRACT_HOOKS: to run additional actions to fill-in the build directory (Replace 'DOC' with the uppercase name of the document, and 'FMT' with the format.) This is supposed to replace the current use of overloading the internal dependency rules, and makes GENDOC behave yet a bit more like the package infrastructure. Signed-off-by: "Yann E. MORIN" Cc: Samuel Martin Cc: Thomas De Schampheleire --- docs/manual/manual.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk index cd944fa..119010b 100644 --- a/docs/manual/manual.mk +++ b/docs/manual/manual.mk @@ -55,10 +55,9 @@ $(1): $(1)-$(5) .PHONY: $(1)-$(5) $(1)-$(5): $$(O)/docs/$(1)/$(1).$(6) -$(1)-check-dependencies: gendoc-check-dependencies - gendoc-check-dependencies-$(5): $(1)-check-dependencies-$(5): gendoc-check-dependencies-$(5) + $$(Q)$$(foreach hook,$$($$(call UPPERCASE,$(pkgname))_EXTRA_CHECK_DEPENDENCIES_$(5)),$$(call $$(hook))$$(sep)) $(2)_$(4)_ASCIIDOC_CONF = $(3)/asciidoc-$(4).conf ifneq ($$(wildcard $$($(2)_$(4)_ASCIIDOC_CONF)),) @@ -110,6 +109,10 @@ endef # resources, such as images, are located; must be an absolute path. ################################################################################ define GENDOC +# Single line, because splitting a foreach is not easy... +$(pkgname)-check-dependencies: gendoc-check-dependencies + $$(Q)$$(foreach hook,$$($$(call UPPERCASE,$(pkgname))_EXTRA_CHECK_DEPENDENCIES),$$(call $$(hook))$$(sep)) + $$(BUILD_DIR)/$(pkgname): $$(Q)mkdir -p $$@ @@ -117,7 +120,9 @@ $(pkgname)-rsync: $$(BUILD_DIR)/$(pkgname) $$(Q)$$(call MESSAGE,"Preparing the $(pkgname) sources...") $$(Q)rsync -a $(pkgdir) $$^ +# Single line, because splitting a foreach is not easy... $(pkgname)-prepare-sources: $(pkgname)-rsync + $$(Q)$$(foreach hook,$$($$(call UPPERCASE,$(pkgname))_POST_EXTRACT_HOOKS),$$(call $$(hook))$$(sep)) $(call GENDOC_INNER,$(pkgname),$$(call UPPERCASE,$(pkgname)),$(pkgdir),xhtml,html,html,HTML,\ --xsltproc-opts "--stringparam toc.section.depth 1")