'merged.config' may not always be present (e.g. when no files to merge
are present). In order to always have an up-to-date configuration file
'out.config' will be generated mirroring the content of 'autoconf.h'.
This is the file that the build system will include to read the current
configuration symbols.
In Windows setups using MSYS environment variables which start with a
slash get the 'root path' added. This adds a second slash to the content
of KCONFIG_AUTOHEADER_HEADER, so the first one is escaped when building
on those platforms.
This adds a check to decide if Kconfig should run on a build. It will
run if any of the following conditions is true:
- A file with '.config' extension is present in the application folder
- A 'Kconfig' file is present in the application folder
- A previous configuration file is present (e.g. from a previous call to
menuconfig)
- menuconfig is being called
This assumes that Kconfig will not generate any default configurations
just from the Kconfig files outside the application folder (i.e. module
configuration via Kconfig is disabled by default). Should this change,
the check would not longer be valid, and Kconfig would have to run on
every build.
- The autoconf.h header file, generated with the current Kconfig
configurations, is added as a build dependency.
- autoconf.h depends on the proper tool (genconfig) and a Kconfig.dep
which contains the dependencies for the given application and board,
this is generated from $(USEMODULE).
- The menuconfig target is added, to allow the configuration of modules
using the Kconfig system.