This example demonstrates how you may conditionally have -Dxxx based on a CONFIG_. It may be helpful if you are converting a legacy kernel_module with Kbuild containing lines like this:
ccflags-$(CONFIG_DDK_EXAMPLE_FOO_DEBUG) := -DDEBUG
To achieve the above result, do the following:
debug.h to srcsdebug.h. There are two ways to do this:["-include", "$(location debug.h)"] to copts; OR#include "debug.h" to foo.c directly. See local_includes for details on including local headers.Full sources of this example are in this directory.