From patchwork Fri Oct 3 17:01:48 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: 396327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id A2FD314017E for ; Sat, 4 Oct 2014 03:02:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CA935962DB; Fri, 3 Oct 2014 17:02:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 98vflSiEldxi; Fri, 3 Oct 2014 17:02:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 08AA796320; Fri, 3 Oct 2014 17:02:33 +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 CD0211C2239 for ; Fri, 3 Oct 2014 17:02:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CADF692EA3 for ; Fri, 3 Oct 2014 17:02:23 +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 sg2HcM17n5pK for ; Fri, 3 Oct 2014 17:02:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2265992E51 for ; Fri, 3 Oct 2014 17:02:22 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id hi2so2002005wib.3 for ; Fri, 03 Oct 2014 10:02: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=9sRU9B40l4uIlrT6J6YZXeZXpKr7QgFYwWfrVPmXfjo=; b=fGJfl8YivT1tz7hLGEtJVqBwShROiVHp/5AkRj3e6YgZaxwLub296GpsuMdGl4eau3 DXRZkitO0PAJoXu+eRZeg44H2Db9Z61xgmJXfh9NVxDMBZkT7uonNdX4hIW+/GxWs1V5 /3Byv8Neg1CUpLCyK3PhcobZn4AyaBP39RwQlUuOOG6LBqVyuEVJrVG3Fiu2X+ptuQea ClBCKi/vYIlglw0n5AoN2ENtWDM/PHZL24/OgELGD8BZr2DTh0vEdK/KLEAwTSKQk0BR nyNXSXTHqNvKMKV0lcbu4xDGpHBzqivpxONfIOYONBJQH5Q3Ydp14TgKMHD9ftQdhwTK 4t9A== X-Received: by 10.194.57.5 with SMTP id e5mr8791954wjq.128.1412355741174; Fri, 03 Oct 2014 10:02:21 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id be1sm2661427wib.4.2014.10.03.10.02.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Oct 2014 10:02:20 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 3 Oct 2014 19:01:48 +0200 Message-Id: <9eed5e86f9741e6d68646e21f5348d89311a1d60.1412355549.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 14/25 v7] 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 Acked-by: Thomas De Schampheleire --- Changes v6 -> v7: - reinstate $$ when calling UPPERCASE (Thomas DS) Changes v5 -> v6: - do not use $$ when calling 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 f6ef71e..ee7887c 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