diff options
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r-- | scripts/Makefile.build | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index e4deb73e9a84..a1a5cf95a68d 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -115,7 +115,10 @@ endif | |||
115 | # --------------------------------------------------------------------------- | 115 | # --------------------------------------------------------------------------- |
116 | 116 | ||
117 | # Default is built-in, unless we know otherwise | 117 | # Default is built-in, unless we know otherwise |
118 | modkern_cflags = $(if $(part-of-module), $(CFLAGS_MODULE), $(CFLAGS_KERNEL)) | 118 | modkern_cflags = \ |
119 | $(if $(part-of-module), \ | ||
120 | $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \ | ||
121 | $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL)) | ||
119 | quiet_modtag := $(empty) $(empty) | 122 | quiet_modtag := $(empty) $(empty) |
120 | 123 | ||
121 | $(real-objs-m) : part-of-module := y | 124 | $(real-objs-m) : part-of-module := y |
@@ -156,14 +159,14 @@ $(obj)/%.i: $(src)/%.c FORCE | |||
156 | 159 | ||
157 | cmd_gensymtypes = \ | 160 | cmd_gensymtypes = \ |
158 | $(CPP) -D__GENKSYMS__ $(c_flags) $< | \ | 161 | $(CPP) -D__GENKSYMS__ $(c_flags) $< | \ |
159 | $(GENKSYMS) -T $@ -a $(ARCH) \ | 162 | $(GENKSYMS) $(if $(1), -T $(2)) -a $(ARCH) \ |
160 | $(if $(KBUILD_PRESERVE),-p) \ | 163 | $(if $(KBUILD_PRESERVE),-p) \ |
161 | $(if $(1),-r $(firstword $(wildcard $(@:.symtypes=.symref) /dev/null))) | 164 | -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null)) |
162 | 165 | ||
163 | quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ | 166 | quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ |
164 | cmd_cc_symtypes_c = \ | 167 | cmd_cc_symtypes_c = \ |
165 | set -e; \ | 168 | set -e; \ |
166 | $(call cmd_gensymtypes, true) >/dev/null; \ | 169 | $(call cmd_gensymtypes,true,$@) >/dev/null; \ |
167 | test -s $@ || rm -f $@ | 170 | test -s $@ || rm -f $@ |
168 | 171 | ||
169 | $(obj)/%.symtypes : $(src)/%.c FORCE | 172 | $(obj)/%.symtypes : $(src)/%.c FORCE |
@@ -192,16 +195,16 @@ else | |||
192 | # the actual value of the checksum generated by genksyms | 195 | # the actual value of the checksum generated by genksyms |
193 | 196 | ||
194 | cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< | 197 | cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< |
195 | cmd_modversions = \ | 198 | cmd_modversions = \ |
196 | if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ | 199 | if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ |
197 | $(call cmd_gensymtypes, $(KBUILD_SYMTYPES)) \ | 200 | $(call cmd_gensymtypes,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ |
198 | > $(@D)/.tmp_$(@F:.o=.ver); \ | 201 | > $(@D)/.tmp_$(@F:.o=.ver); \ |
199 | \ | 202 | \ |
200 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | 203 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ |
201 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | 204 | -T $(@D)/.tmp_$(@F:.o=.ver); \ |
202 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ | 205 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ |
203 | else \ | 206 | else \ |
204 | mv -f $(@D)/.tmp_$(@F) $@; \ | 207 | mv -f $(@D)/.tmp_$(@F) $@; \ |
205 | fi; | 208 | fi; |
206 | endif | 209 | endif |
207 | 210 | ||
@@ -248,10 +251,10 @@ $(obj)/%.lst: $(src)/%.c FORCE | |||
248 | # Compile assembler sources (.S) | 251 | # Compile assembler sources (.S) |
249 | # --------------------------------------------------------------------------- | 252 | # --------------------------------------------------------------------------- |
250 | 253 | ||
251 | modkern_aflags := $(AFLAGS_KERNEL) | 254 | modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL) |
252 | 255 | ||
253 | $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) | 256 | $(real-objs-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) |
254 | $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) | 257 | $(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) |
255 | 258 | ||
256 | quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ | 259 | quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ |
257 | cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< | 260 | cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< |