The kernels for Debian stretch require some special CFLAGS settings which are only correctly defined when NOSTDINC_FLAGS is defined inside the execution of the Makefile via kbuild. But batman-adv sets it currently outside to insert compatibility include headers and compat-sources.
This can be avoided by making the top Makefile kbuild compatible and redefining the NOSTDINC_FLAGS when kbuild include this Makefile. The actual build of the batman-adv module is then done by adding the subdirectory to obj-y. Signed-off-by: Sven Eckelmann <s...@narfation.org> --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 365a7cc..d662573 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ RM ?= rm -f REVISION= $(shell if [ -d "$(PWD)/.git" ]; then \ echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \ fi) -export NOSTDINC_FLAGS := \ +NOSTDINC_FLAGS := \ -I$(PWD)/compat-include/ \ -I$(PWD)/include/ \ -include $(PWD)/compat.h \ @@ -54,11 +54,13 @@ NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\" endif include $(PWD)/compat-sources/Makefile - +obj-y += net/batman-adv/ export batman-adv-y BUILD_FLAGS := \ - M=$(PWD)/net/batman-adv \ + M=$(PWD) \ + PWD=$(PWD) \ + REVISION=$(REVISION) \ CONFIG_BATMAN_ADV=m \ CONFIG_BATMAN_ADV_DEBUG=$(CONFIG_BATMAN_ADV_DEBUG) \ CONFIG_BATMAN_ADV_BLA=$(CONFIG_BATMAN_ADV_BLA) \ @@ -66,7 +68,7 @@ BUILD_FLAGS := \ CONFIG_BATMAN_ADV_NC=$(CONFIG_BATMAN_ADV_NC) \ CONFIG_BATMAN_ADV_MCAST=$(CONFIG_BATMAN_ADV_MCAST) \ CONFIG_BATMAN_ADV_BATMAN_V=$(CONFIG_BATMAN_ADV_BATMAN_V) \ - INSTALL_MOD_DIR=updates/net/batman-adv/ + INSTALL_MOD_DIR=updates/ all: config $(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) modules -- 2.8.1