Commit Graph

7 Commits

Author SHA1 Message Date
Huihuang Shi d859182d41 customize function to generate config.h with proper suffixes
Add new format to parsed by kconfig to support
U and UL.
When config is 'int',if this symbol have 'range'
key words and bigger or qeual to 0,the int macro
will have suffix 'U'.
When config is 'hex',the suffix is 'U'.
When config have 'help' keywords,and the help contents
have the string "64-bit integer",it will add suffix 'L'.

V1->V2:
     1.modified the comments to let it much eaisy to understand.
     2.change the values' name protected_foot,protected_tai to
     guard_begin and guard_end.
     3.add regex to identified the '64-bit' and 'integer'.

V2->V3:
     1.remove kconfiglib internal attribute
     2.use config_string to avoid no active config entry

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
2018-10-12 16:32:25 +08:00
Junjie Mao 5251f42574 HV: make: rename minimalconfig to savedefconfig
... following the naming convention of Linux kbuild.

v1 -> v2:

    * Introduced.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
2018-06-15 15:50:09 +08:00
Junjie Mao c4493cc1f8 HV: make: skip duplicated PLATFORM= on command line
Since .config has PLATFORM now, it is expected that the PLATFORM= command line
option is no longer necessary as long as a proper .config exists.

This patch implements this expectation. Now the platform to be selected is
determined by the following steps.

    1. If PLATFORM= is provided on the command line, the specified value is
       used.
    2. If there is no PLATFORM= on the command line and PLATFORM is defined in
       config.mk, its value is used.
    3. If neither PLATFORM= on the command line nor config.mk is available, a
       predefined default value is used.

v1 -> v2:

    * 'make oldconfig' should not pass CONFIG_xxx to the script since config.mk
      can be out-dated.
    * Change the default value of PLATFORM to SBL for backward compatibility of
      'make all'.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
2018-06-15 15:50:09 +08:00
Junjie Mao 6df3ac0038 HV: make: add menuconfig
This patch enables 'make menuconfig' leveraging the menuconfig.py in kconfiglib,
which shows a TUI for modifying the current configurations.

Menuconfig.py is python3 only, and thus the existence of 'python3' instead of
'python' is checked and python3 is used to run all the scripts.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
2018-06-15 15:50:09 +08:00
Junjie Mao 216f4e78a8 HV: make: append dependency checking targets to a given variable
The current implementation of the check_dep_* macros always append the
prerequisite checking target to BUILD_DEPS, but there are some cases when some
prerequisites are only necessary for some specific targets instead of general
builds.

This patch adds a second parameter to the check_dep_* macros specifying which
variable the generated target should be appended to.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
2018-06-15 15:50:09 +08:00
Junjie Mao 10518de722 make: add functions for checking build prerequisites
This patch introduces the following functions for Makefiles:

  check_dep_exec <exe>

      Check existence of the executable <exe>

  check_dep_pylib <lib>

      Check existence of the python library <lib>

Calling and evaluting the functions will create a check_xxx target and add the
target to the variable BUILD_DEPS. Thus it is sufficient to add the following
to a Makefile for checking a number of build dependencies.

  include deps.mk
  $(eval $(call check_dep_exec,python))
  $(eval $(call check_dep_pylib,Sphinx))
  all: $(BUILD_DEPS) ...

v4 -> v5:

    * No changes.

v3 -> v4:

    * No changes.

v2 -> v3:

    * No changes.

v1 -> v2:

    * New in v2.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2018-06-08 17:21:13 +08:00
Junjie Mao 647aee6e34 scripts: introduce .config/config.h generators
This patch introduces some scripts that takes a Kconfig script and generates
.config or config.h. These scripts are general and can be used by the
hypervisor, dm, tools, etc. as long as proper make targets are added.

Note: Kconfiglib by Ulf Magnusson is ISC licensed.

v4 -> v5:

    * Add minimalconfig which creates a defconfig by minimizing a given .config.

v3 -> v4:

    * silentoldconfig now properly generate a .config if an old one does not
      exist.

v2 -> v3:

    * Add license info and the permission notice of Kconfiglib.
    * Mention the input Kconfig in the script descriptions.

v1 -> v2:

    * Drop kconfiglib.py. The getting started guide will be updated accordingly
      and dependency checks will be added to Makefile in the following patches.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2018-06-08 17:21:13 +08:00