summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Hieber <r.hieber@pengutronix.de>2018-10-09 12:51:06 +0200
committerRoland Hieber <r.hieber@pengutronix.de>2018-10-09 12:51:06 +0200
commitd1e76fd4775b25ffe9541a83c34d02659bac7de8 (patch)
tree230c732d774723ad0cdc30100dbab2a0d41b4228
parent5a2c218d0aa995987bdc08a8578f5fe2d8f153e3 (diff)
downloadptxdist-d1e76fd4775b25ffe9541a83c34d02659bac7de8.tar.gz
ptxdist-d1e76fd4775b25ffe9541a83c34d02659bac7de8.tar.xz
doc: ref manual: describe downloading multiple source files in get stage
Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
-rw-r--r--doc/ref_manual.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/ref_manual.rst b/doc/ref_manual.rst
index 00313182c..4b250506d 100644
--- a/doc/ref_manual.rst
+++ b/doc/ref_manual.rst
@@ -610,6 +610,13 @@ Example:
@$(call world/check_src, FOOBAR_MOD)
@$(call touch)
+.. note::
+
+ This example should illustrate the use of ``world/get`` and
+ ``world/check_src``, but it is not very idiomatic.
+ If you want to download multiple files in the *get* stage, have a look at the
+ section `Downloading Multiple Source Files`_.
+
Target-Install Stage Macros
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1370,6 +1377,35 @@ to download the source archive and check for itsvalidity.
If ``<PKG>_SOURCE`` is not set, ``<PKG>_SOURCES`` will be empty,
so the *get* stage will download nothing.
+This mechanism is flexible enough that it can be used for multiple archives:
+
+Downloading Multiple Source Files
+'''''''''''''''''''''''''''''''''
+
+Indeed, you can specify multiple source archives in this variable, which then
+get downloaded all together in the default *get* stage. To do this, simply
+override ``<PKG>_SOURCES`` in your ``rules/<pkg>.make``, and provide the
+backreference from the source archive to the package prefix. Here is an
+example for an imaginary package *foobar*:
+
+.. code-block:: make
+
+ FOOBAR_SOURCE := $(SRCDIR)/foobar-$(FOOBAR_VERSION).tar.gz
+ FOOBAR_URL := http://example.org/foobar-$(FOOBAR_VERSION).tar.gz
+ FOOBAR_MD5 := 68b329da9893e34099c7d8ad5cb9c940
+ FOOBAR_MOD_SOURCE := $(SRCDIR)/foobar-modules-$(FOOBAR_VERSION).tar.gz
+ FOOBAR_MOD_URL := http://example.org/foobar-modules-$(FOOBAR_VERSION).tar.gz
+ FOOBAR_MOD_MD5 := d784fa8b6d98d27699781bd9a7cf19f0
+
+ # We want to download multiple sources:
+ $(FOOBAR_SOURCE) := FOOBAR
+ $(FOOBAR_MOD_SOURCE) := FOOBAR_MOD
+ FOOBAR_SOURCES := $(FOOBAR_SOURCE) $(FOOBAR_MOD__SOURCE)
+
+This way the default *get* stage can be used to download multiple source
+archives, but you will still need to extract them separately in the *extract*
+stage.
+
extract Stage Default Rule
^^^^^^^^^^^^^^^^^^^^^^^^^^