Then, Kconfig shapes the Makefile Using the "y" trick you turn 3-lines conditionals into 1 line obj-$(CONFIG_FOO) += foo.o cflags-$(CONFIG_BAR) += -DBAR Kconfig appears to suggest use of #ifdef/#endif Please avoid #ifdef, it's the source of most bugs in C With proper Kconfig values (int, not bool) you can do better Remember that no code is emitted for "if (0)" blocks If any, can turn #ifdef into a constant in your own file Possibly, use the compiler's help __builtin_constant_p() for example