From patchwork Sat Sep 27 10:16:50 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: 394049 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 437E714017A for ; Sat, 27 Sep 2014 20:19:10 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 874D392348; Sat, 27 Sep 2014 10:19:09 +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 RniC1ytOQmky; Sat, 27 Sep 2014 10:19:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 47DE8922CC; Sat, 27 Sep 2014 10:17:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9D4F51C26F1 for ; Sat, 27 Sep 2014 10:17:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 85B72923D9 for ; Sat, 27 Sep 2014 10:17:47 +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 3FAbRK2ljIBA for ; Sat, 27 Sep 2014 10:17:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by whitealder.osuosl.org (Postfix) with ESMTPS id 212C4923C6 for ; Sat, 27 Sep 2014 10:17:22 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id x13so7752812wgg.7 for ; Sat, 27 Sep 2014 03:17:21 -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=Muvh1Kjhx9nA4/7yJYO41fBiTRjTmJZWXng+mZIsu64=; b=SkaGVRXAr+TP6B3Ub1tXueAHYWLSBgR2cBzfdlL34f0gsyf01mjUBwZOdI1gT5IFXN NXvJiCyFA+pK5moG8tarDNkv257jbf0l31rCElOFUNsLIFOume4+s9FCezMRY1P2YClY xuo4QKiyWEQc6uVIHcTDwcHTYO0BCYNG1HsR2mQLFDjdK27Z3bGCfh1hSONnV3nfxPCG o1hPyCqt1OkQnnP+pTPORWiYqTFoSgkDnxMFVmiKHLZRntTp7QYSnhaKzRJST9WZjSga nTDZX8a+WFcxGuzmpXw7t/vIOg++ZuZ+sZuPErtVWcYNU0EmfYv+3KrQfA/XVKhtgtGs So0A== X-Received: by 10.194.88.99 with SMTP id bf3mr30054570wjb.16.1411813041665; Sat, 27 Sep 2014 03:17:21 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id lf1sm9003096wjb.24.2014.09.27.03.17.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 27 Sep 2014 03:17:21 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sat, 27 Sep 2014 12:16:50 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 14/25 v6] docs/manual: allow documents to define some hooks, as for a package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" Allow documents to define two hooks: - DOC_CHECK_EXTRA_DEPENDENCIES_HOOKS to check for extra dependencies required by this document - DOC_CHECK_EXTRA_DEPENDENCIES_FMT_HOOKS 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. Note that GENDOC_INNER already has the uppercase name as an argument, whereas GENDOC does not, so the two foreach loops are not exactly similar (for now.) Signed-off-by: "Yann E. MORIN" Cc: Samuel Martin Cc: Thomas De Schampheleire Reviewed-by: Samuel Martin --- Changes v5 -> v6: - do not use $$ for call to UPPERCASE (Thomas DS) Changes v1 -> v2: - call post-extract hook in rsync rule --- docs/manual/manual.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk index 26906b5..2ee680e 100644 --- a/docs/manual/manual.mk +++ b/docs/manual/manual.mk @@ -55,10 +55,10 @@ $(1): $(1)-$(5) .PHONY: $(1)-$(5) $(1)-$(5): $$(O)/docs/$(1)/$(1).$(6) -$(1)-check-dependencies: gendoc-check-dependencies - +# Single line, because splitting a foreach is not easy... gendoc-check-dependencies-$(5): $(1)-check-dependencies-$(5): gendoc-check-dependencies-$(5) + $$(Q)$$(foreach hook,$$($(2)_CHECK_DEPENDENCIES_$(call UPPERCASE,$(5))_HOOKS),$$(call $$(hook))$$(sep)) $(2)_$(4)_ASCIIDOC_CONF = $(3)/asciidoc-$(4).conf ifneq ($$(wildcard $$($(2)_$(4)_ASCIIDOC_CONF)),) @@ -110,12 +110,18 @@ 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))_CHECK_DEPENDENCIES_HOOKS),$$(call $$(hook))$$(sep)) + $$(BUILD_DIR)/docs/$(pkgname): $$(Q)mkdir -p $$@ +# Single line, because splitting a foreach is not easy... $(pkgname)-rsync: $$(BUILD_DIR)/docs/$(pkgname) $$(Q)$$(call MESSAGE,"Preparing the $(pkgname) sources...") $$(Q)rsync -a $(pkgdir) $$^ + $$(Q)$$(foreach hook,$$($(call UPPERCASE,$(pkgname))_POST_RSYNC_HOOKS),$$(call $$(hook))$$(sep)) $(pkgname)-prepare-sources: $(pkgname)-rsync