diff options
author | Juergen Borleis <jbe@pengutronix.de> | 2019-02-22 14:18:49 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-02-26 09:13:26 +0100 |
commit | 831da8a7a6f88827024b38d52afd073c55bc1e60 (patch) | |
tree | 1304667189fabbbf97ff7eb970874b7691081840 | |
parent | b964b8186bfb4f2e903981fb1f4be8e015bef53e (diff) | |
download | ptxdist-831da8a7a6f88827024b38d52afd073c55bc1e60.tar.gz ptxdist-831da8a7a6f88827024b38d52afd073c55bc1e60.tar.xz |
doc: mention dedicated PTXdist macros to be used in rule files
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>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | doc/dev_manual.rst | 40 |
1 files 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: |