mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/3] doc: mention dedicated PTXdist macros to be used in rule files
@ 2019-02-22 13:18 Juergen Borleis
  2019-02-22 13:18 ` [ptxdist] [PATCH 2/3] doc: follow the rule to use breaking lines Juergen Borleis
  2019-02-22 13:18 ` [ptxdist] [PATCH 3/3] doc: improve the suboption name scheme description Juergen Borleis
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Borleis @ 2019-02-22 13:18 UTC (permalink / raw)
  To: ptxdist

In order to simplify rule files, it's worth to use more of the provided
rule file option macros PTXdist already provides. Show only this optimized
example and remove the previous version from the old days.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 doc/dev_manual.rst | 40 +++++++++-------------------------------
 1 file changed, 9 insertions(+), 31 deletions(-)

diff --git a/doc/dev_manual.rst b/doc/dev_manual.rst
index f0c2e00ee..10091c76c 100644
--- a/doc/dev_manual.rst
+++ b/doc/dev_manual.rst
@@ -892,24 +892,18 @@ file and add the correct parameters:
     #
     # autoconf
     #
-    FOO_CONF_OPT := $(CROSS_AUTOCONF_USR)
-
-    ifdef PTXCONF_FOO_DEBUG
-    FOO_CONF_OPT += --enable-debug
-    else
-    FOO_CONF_OPT += --disable-debug
-    endif
-
-    ifdef PTXCONF_FOO_BAR
-    FOO_CONF_OPT += --with-bar
-    else
-    FOO_CONF_OPT += --without-bar
-    endif
+    FOO_CONF_OPT := \
+        $(CROSS_AUTOCONF_USR) \
+        --$(call ptx/endis, PTXCONF_FOO_DEBUG)-debug \
+        --$(call ptx/wwo, PTXCONF_FOO_BAR)-bar
 
-.. important:: Please note the trailing ``PTXCONF_`` for each define. While Kconfig is
+.. important:: Please note the leading ``PTXCONF_`` for each define. While Kconfig is
   using ``FOO_BAR``, the rule file must use ``PTXCONF_FOO_BAR`` instead.
 
-It is a good practice to add both settings, e.g. ``--disable-debug``
+.. note:: Refer :ref:`Rule File Macro Reference <param_macros>` for further
+   details about these special kind of option macros (e.g. ``ptx/...``).
+
+It is a good practice to always add both settings, e.g. ``--disable-debug``
 even if this is the default case. Sometimes ``configure`` tries to guess
 something and the binary result might differ depending on the build
 order. For example some kind of package would also build some X related
@@ -950,22 +944,6 @@ In this example, many configure options from libsigrok (marked with ``+``)
 are not yet present in ``LIBSIGROK_CONF_OPT`` and must be added, possibly also
 by providing more dynamic options in the package definition.
 
-Since every optional parameter adds four lines of code to the rule
-files, PTXdist provides some shortcuts to handle it. Refer to section
-:ref:`param_macros` for further details.
-
-With these special macros in use, the file content shown above looks
-much simpler:
-
-.. code-block:: make
-
-    #
-    # autoconf
-    #
-    FOO_CONF_OPT := $(CROSS_AUTOCONF_USR) \
-    	$(call ptx/endis, PTXCONF_FOO_DEBUG)-debug \
-    	$(call ptx/wwo, PTXCONF_FOO_BAR)-bar
-
 If some parts of a package are built on demand only, they must also be
 installed on demand only. Besides the *prepare* stage, we also must
 modify our *targetinstall* stage:
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ptxdist] [PATCH 2/3] doc: follow the rule to use breaking lines
  2019-02-22 13:18 [ptxdist] [PATCH 1/3] doc: mention dedicated PTXdist macros to be used in rule files Juergen Borleis
@ 2019-02-22 13:18 ` Juergen Borleis
  2019-02-22 13:18 ` [ptxdist] [PATCH 3/3] doc: improve the suboption name scheme description Juergen Borleis
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Borleis @ 2019-02-22 13:18 UTC (permalink / raw)
  To: ptxdist

Synchronize the examples.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 doc/dev_manual.rst | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/dev_manual.rst b/doc/dev_manual.rst
index 10091c76c..523ecde28 100644
--- a/doc/dev_manual.rst
+++ b/doc/dev_manual.rst
@@ -812,9 +812,10 @@ in this line and supplement this expression as follows:
 
 .. code-block:: make
 
-    FOO_CONF_OPT := $(CROSS_AUTOCONF_USR) \
-    	--enable-debug \
-    	--with-bar
+    FOO_CONF_OPT := \
+        $(CROSS_AUTOCONF_USR) \
+        --enable-debug \
+        --with-bar
 
 .. note:: We recommend to use this format with each parameter on a line of
  its own. This format is easier to read and a diff shows more exactly any
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ptxdist] [PATCH 3/3] doc: improve the suboption name scheme description
  2019-02-22 13:18 [ptxdist] [PATCH 1/3] doc: mention dedicated PTXdist macros to be used in rule files Juergen Borleis
  2019-02-22 13:18 ` [ptxdist] [PATCH 2/3] doc: follow the rule to use breaking lines Juergen Borleis
@ 2019-02-22 13:18 ` Juergen Borleis
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Borleis @ 2019-02-22 13:18 UTC (permalink / raw)
  To: ptxdist

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 doc/dev_manual.rst | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/dev_manual.rst b/doc/dev_manual.rst
index 523ecde28..e17aa9b1b 100644
--- a/doc/dev_manual.rst
+++ b/doc/dev_manual.rst
@@ -881,9 +881,10 @@ add on demand to the ``configure`` parameters:
 
     endif
 
-.. note:: To extend the base name by a suboption name as a trailing
-  component gives PTXdist the ability to detect a change in the package’s
-  settings to force its rebuild.
+.. important:: Always follow the rule to extend the base name by a suboption
+  name as the trailing part of the variable name. This gives PTXdist the ability
+  to detect a change in the package’s settings (via menuconfig) to force its
+  rebuild on demand.
 
 To make usage of the new menu entries, we must check them in the rule
 file and add the correct parameters:
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-22 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 13:18 [ptxdist] [PATCH 1/3] doc: mention dedicated PTXdist macros to be used in rule files Juergen Borleis
2019-02-22 13:18 ` [ptxdist] [PATCH 2/3] doc: follow the rule to use breaking lines Juergen Borleis
2019-02-22 13:18 ` [ptxdist] [PATCH 3/3] doc: improve the suboption name scheme description Juergen Borleis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox