2018年1月17日 星期三

[Embedded System][make menuconfig] How to define tag and use it under Makefile and code

  1. Edit Kconfig
edit vendor/vendor.Kconfig
Add following line
config CONFIG_VENDOR_HAPPY
    bool "support"
        default y
        help
                Enable code
Execute “make menuconfig” will generate “.config”.
  1. Put into the code
#ifdef CONFIG_VENDOR_HAPPY
void customer()
{
    if (!Clean)
    {
        Clean = 1;
    }

}
#endif //CONFIG_VENDOR_HAPPY
  1. Put into the Makefile
    -include $(TARGET_HOME)/.config
    ifeq ($(GOGO),y)

0 意見:

張貼留言