summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--scripts/Makefile.build1
2 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c48bfc9e3dfa..000fbdaddf6a 100644
--- a/Makefile
+++ b/Makefile
@@ -330,7 +330,10 @@ DEPMOD = /sbin/depmod
KALLSYMS = scripts/kallsyms
PERL = perl
CHECK = sparse
+
+NOSTDINC_FLAGS := -nostdinc -isystem $(shell $(CC) -print-file-name=include)
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__
+CHECKFLAGS += $(NOSTDINC_FLAGS)
MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS)
@@ -338,7 +341,6 @@ LDFLAGS_MODULE = -r
CFLAGS_KERNEL =
AFLAGS_KERNEL =
-NOSTDINC_FLAGS = -nostdinc -iwithprefix include
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d2263a3594d2..352d531ee3c1 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -83,7 +83,6 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
# Linus' kernel sanity checking tool
ifneq ($(KBUILD_CHECKSRC),0)
- CHECKFLAGS += -I$(shell $(CC) -print-file-name=include)
ifeq ($(KBUILD_CHECKSRC),2)
quiet_cmd_force_checksrc = CHECK $<
cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;