summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2019-03-13 15:33:23 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-03-13 16:49:52 +0100
commit402de3b6ca51efc2430bb21bd432633131706803 (patch)
tree8bcfc6a7db41f924b2bfae622393152ac82d6c8a /doc
parent4e368cf79500e2eb1bb6d41cf03870d1df96a5e3 (diff)
downloadptxdist-402de3b6ca51efc2430bb21bd432633131706803.tar.gz
ptxdist-402de3b6ca51efc2430bb21bd432633131706803.tar.xz
doc: add ptx/truefalse macro description
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'doc')
-rw-r--r--doc/ref_manual.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/ref_manual.rst b/doc/ref_manual.rst
index e2be86060..4444e0192 100644
--- a/doc/ref_manual.rst
+++ b/doc/ref_manual.rst
@@ -1201,6 +1201,33 @@ Depending on the state of FOO_VARIABLE this line results into
FOO_CONF_OPT += --with-something=/usr (if FOO_VARIABLE is set)
FOO_CONF_OPT += --with-something=none (if FOO_VARIABLE is unset)
+ptx/truefalse
+~~~~~~~~~~~~~
+
+To convert the state (set/unset) of a variable into a ``true/false``
+string use the ``ptx/truefalse`` macro.
+If the given <variable> is set this macro expands to
+the string ``true``, if unset to ``false`` instead.
+
+Usage:
+
+.. code-block:: none
+
+ -Dwith-something=$(call ptx/truefalse,<variable>)
+
+An example:
+
+.. code-block:: make
+
+ FOO_CONF_OPT += -Dwith-something=$(call ptx/truefalse,<variable>)
+
+Depending on the state of FOO_VARIABLE this line results into
+
+.. code-block:: make
+
+ FOO_CONF_OPT += -Dwith-something=true (if FOO_VARIABLE is set)
+ FOO_CONF_OPT += -Dwith-something=false (if FOO_VARIABLE is unset)
+
ptx/get-alternative
~~~~~~~~~~~~~~~~~~~