summaryrefslogtreecommitdiff
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-08-19 17:58:43 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-08-22 01:14:11 +0900
commiteb27ea5ce7f367b185953cc9bc6e606004cfd8c4 (patch)
tree9b49344af8c36e30e9c846ead46c00b704c65195 /scripts/Makefile.lib
parent2ff2b7ec65dcea2261bdf404654975f44ad6323d (diff)
downloadlwn-eb27ea5ce7f367b185953cc9bc6e606004cfd8c4.tar.gz
lwn-eb27ea5ce7f367b185953cc9bc6e606004cfd8c4.zip
kbuild: move modkern_{c,a}flags to Makefile.lib from Makefile.build
Makefile.lib is included by Makefile.modfinal as well as Makefile.build. Move modkern_cflags to Makefile.lib in order to simplify cmd_cc_o_c in Makefile.modfinal. Move modkern_cflags as well for consistency. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 264611972c4a..888e5c830646 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -159,6 +159,18 @@ _cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
endif
endif
+part-of-module = $(if $(filter $(basename $@).o, $(real-obj-m)),y)
+quiet_modtag = $(if $(part-of-module),[M], )
+
+modkern_cflags = \
+ $(if $(part-of-module), \
+ $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
+ $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
+
+modkern_aflags = $(if $(part-of-module), \
+ $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \
+ $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL))
+
c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
-include $(srctree)/include/linux/compiler_types.h \
$(_c_flags) $(modkern_cflags) \