diff options
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0f81dcfd6909..550798f57da5 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -81,8 +81,10 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) | |||
81 | # Note: It's possible that one object gets potentially linked into more | 81 | # Note: It's possible that one object gets potentially linked into more |
82 | # than one module. In that case KBUILD_MODNAME will be set to foo_bar, | 82 | # than one module. In that case KBUILD_MODNAME will be set to foo_bar, |
83 | # where foo and bar are the name of the modules. | 83 | # where foo and bar are the name of the modules. |
84 | basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) | 84 | name-fix = $(subst $(comma),_,$(subst -,_,$1)) |
85 | modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname)))) | 85 | basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))" |
86 | modname_flags = $(if $(filter 1,$(words $(modname))),\ | ||
87 | -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") | ||
86 | 88 | ||
87 | _c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) | 89 | _c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) |
88 | _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) | 90 | _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) |
@@ -113,7 +115,7 @@ endif | |||
113 | 115 | ||
114 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ | 116 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ |
115 | $(__c_flags) $(modkern_cflags) \ | 117 | $(__c_flags) $(modkern_cflags) \ |
116 | $(basename_flags) $(modname_flags) | 118 | -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) |
117 | 119 | ||
118 | a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ | 120 | a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ |
119 | $(__a_flags) $(modkern_aflags) | 121 | $(__a_flags) $(modkern_aflags) |