Extra_cflags + =-D with Config_ =y
1.
If you define a macro config_debug
Defined in. C as: #define Config_debug
Defined in Makefile as: config_debug=y
If we want to enter a macro definition for a. c file in makefile, use Extra_cflags + = Dconfig_debug(equivalent to defining #define in. c Files config_ DEBUG)
At this point config_debug=y and extra_cflags + = Dconfig_debug The difference should you have seen, the former is used for makefile compile, for example obj-(config_ DEBUG) + = TEST.O, while the latter is used in the. C source file, for example:
#if defined (config_debug)
...
#else
...
#endif
2.
If you define a macro Config_debug = 3
Defined in. C as: #define CONFIG_DEBUG 3
If we want to enter a macro definition for the. c file in makefile, use extra_cflags + =-dconfig_debug=3
At this point the definitions are exactly the same.
Makefile macro definition: Extra_cflags + =-D with Config_ =y