.. _make-pkg:

Make Package
~~~~~~~~~~~~

A make package provides support to easily invoke `GNU Make`_ commands at
various stages of a package.

.. code-block:: python

   LIBFOO_TYPE = 'make'

Make-based projects by default will invoke the default target during the build
stage, and invoke the ``install`` target for the installation stage. Developers
can configure a specific target to invoke during the build stage by specifying
a ``LIBFOO_BUILD_OPTS`` configuration. For example, if a package uses the
target ``release`` for standard release builds, the following can be used:

.. code-block:: python

   LIBFOO_BUILD_OPTS = [
       'release',
   ]

For the installation stage, the ``install`` target is typically invoked.
However, developers can override what target to invoke by adding it into the
install options:

.. code-block:: python

   LIBFOO_INSTALL_OPTS = [
       'install-minimal',
   ]

For packages which do not have an installation target to run, developers can
use the |LIBFOO_MAKE_NOINSTALL|_ option to skip the installation stage for
a package.

Default configurations for a make package will not run a configuration stage.
However, if a user wants to run a specific target during this stage, the
target can be added into the configuration options. For example, if the
Makefile configuration has a target ``prework`` that should be invoked
during the configuration stage, the following can be used:

.. code-block:: python

   LIBFOO_CONF_OPTS = [
       'prework',
   ]

Alternatively, if no configuration options are specified, a
``<package>-configure`` :ref:`script <script-pkg>` can be invoked if available.

The following sections outline configuration options are available for a make
package.

.. _make_build_defs:
.. include:: developer-guide/packages-build-defs

.. _make_build_env:
.. include:: developer-guide/packages-build-env

.. _make_build_opts:
.. include:: developer-guide/packages-build-opts

.. _make_conf_defs:
.. include:: developer-guide/packages-conf-defs

.. _make_conf_env:
.. include:: developer-guide/packages-conf-env

.. _make_conf_opts:
.. include:: developer-guide/packages-conf-opts

.. _make_install_defs:
.. include:: developer-guide/packages-install-defs

.. _make_install_env:
.. include:: developer-guide/packages-install-env

.. _make_install_opts:
.. include:: developer-guide/packages-install-opts

LIBFOO_MAKE_NOINSTALL
^^^^^^^^^^^^^^^^^^^^^
.. |LIBFOO_MAKE_NOINSTALL| replace:: ``LIBFOO_MAKE_NOINSTALL``

Specifies whether a make package should skip an attempt to invoke the
install target. Ideally, projects will have an ``install`` target configured
to define how a project will install files into a target (or staging)
environment. Not all make projects may have this target defined, which
can cause the installation stage for a package to fail. A developer can
specify this no-install flag to skip a make install target request and
manage installation actions through other means (such as post-processing).
By default, the installation stage is invoked with a value of ``False``.

.. code-block:: python

   LIBFOO_MAKE_NOINSTALL = True
