The user should not be encouraged to edit sources to prevent inconsistent changes. Upcoming features will not only use preprocessor variables to enable or disable itself, but also need to compile specific files at the same time. Therefore, it is safer to provide make parameters which can enable everything necessary for a specific option and look similar to the .config options of the kernel.
It is not possible to disable features enabled by the target kernel because the include/generated/autoconf.h of the kernel sources isn't regenerated by a module build. Hence, it is better not to disable features in the makefile by default because the preprocessor will not have the same information. This can be changed later by a more complex configuration system that generates an own compat_autoconf.h that is included by compat.h. This header would have to
Signed-off-by: Sven Eckelmann sven@narfation.org --- Makefile | 7 +++++-- README | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile index 4f338aa..e78e797 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,10 @@ # 02110-1301, USA #
- +# uncomment the CONFIG_* line to enable the related feature +# features enabled in the target kernel configuration cannot be disabled +# B.A.T.M.A.N. debugging: +# CONFIG_BATMAN_ADV_DEBUG=y
PWD:=$(shell pwd) KERNELPATH ?= /lib/modules/$(shell uname -r)/build @@ -38,7 +41,7 @@ batman-adv-y += compat.o ifneq ($(REVISION),) ccflags-y += -DSOURCE_VERSION="$(REVISION)" endif -# ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG +ccflags-$(CONFIG_BATMAN_ADV_DEBUG) += -DCONFIG_BATMAN_ADV_DEBUG include $(PWD)/Makefile.kbuild
all: diff --git a/README b/README index 7404c0a..ddc9569 100644 --- a/README +++ b/README @@ -207,10 +207,10 @@ times necessary to see more detail debug messages. This must be enabled when compiling the batman-adv module. When building bat- man-adv as part of kernel, use "make menuconfig" and enable the option "B.A.T.M.A.N. debugging". When compiling outside of the -kernel tree it is necessary to edit the file Makefile.kbuild and -uncomment the line +kernel tree it is necessary to enable it using the make option +CONFIG_BATMAN_ADV_DEBUG=y
-#ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG +# make CONFIG_BATMAN_ADV_DEBUG=y
Those additional debug messages can be accessed using a special file in debugfs