docs/asciidoc: make it possible to use $(@D) in hooks
authorYann E. MORIN <yann.morin.1998@free.fr>
Fri, 3 Oct 2014 17:01:54 +0000 (19:01 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 12 Oct 2014 05:46:28 +0000 (07:46 +0200)
Currently, it is not possible to use $(@D) in documents' hooks, because
there is no actual target file for the copying rule.

So, use the same mechanism as for generic-package.

We do not touch the target file, so it is easy to regenerate the manual
without calling the -clean rule first.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
docs/manual/manual.mk
package/doc-asciidoc.mk

index a3011c699cfee87462437548d1280bc620c18f4a..d5db2c26c9fbb04dd1272859e0717ccbf8a4c337 100644 (file)
@@ -12,7 +12,7 @@ MANUAL_RESOURCES = $(TOPDIR)/docs/images
 # should not be included in the manual.
 define MANUAL_GEN_LISTS
        $(Q)$(call MESSAGE,"Updating the manual lists...")
-       $(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(BUILD_DIR)/docs/$(pkgname) \
+       $(Q)BR2_DEFCONFIG="" TOPDIR=$(TOPDIR) O=$(@D) \
                BR2_EXTERNAL=$(TOPDIR)/support/dummy-external \
                python -B $(TOPDIR)/support/scripts/gen-manual-lists.py
 endef
index 6b5b2b765cb29b338ef34a5c5a8c8936a0d6c437..9a182707d6481db67ba67f38ca403716faca1bee 100644 (file)
@@ -121,16 +121,16 @@ define ASCIIDOC
 $(1)-check-dependencies: asciidoc-check-dependencies
        $$(Q)$$(foreach hook,$$($(2)_CHECK_DEPENDENCIES_HOOKS),$$(call $$(hook))$$(sep))
 
-$$(BUILD_DIR)/docs/$(1):
-       $$(Q)mkdir -p $$@
-
 # Single line, because splitting a foreach is not easy...
-$(1)-rsync: $$(BUILD_DIR)/docs/$(1)
+# Do not touch the stamp file, so we get to rsync again every time we build
+# the document.
+$$(BUILD_DIR)/docs/$(1)/.stamp_doc_rsynced:
        $$(Q)$$(call MESSAGE,"Preparing the $(1) sources...")
-       $$(Q)rsync -a $(3) $$^
+       $$(Q)mkdir -p $$(@D)
+       $$(Q)rsync -a $(3) $$(@D)
        $$(Q)$$(foreach hook,$$($(2)_POST_RSYNC_HOOKS),$$(call $$(hook))$$(sep))
 
-$(1)-prepare-sources: $(1)-rsync
+$(1)-prepare-sources: $$(BUILD_DIR)/docs/$(1)/.stamp_doc_rsynced
 
 $(call ASCIIDOC_INNER,$(1),$(2),$(3),xhtml,html,html,HTML,\
        --xsltproc-opts "--stringparam toc.section.depth 1")