History

kbuild: add CONFIG_ASM_MODVERSIONS

Add CONFIG_ASM_MODVERSIONS. This allows to remove one if-conditional nesting in scripts/Makefile.build. scripts/Makefile.build is run every time Kbuild descends into a sub-directory. So, I want to avoid $(wildcard ...) evaluation where possible although computing $(wildcard ...) is so cheap that it may not make measurable performance difference.

Masahiro Yamada committed 7 years ago

Commit 2ff2b7e1 parent a564bde14 files · +27 −6Browse files

Showing the changes to scripts (1 of 14 files). Show all

Unified · Split

scripts/Makefile.build+1−6
@@ -349,11 +349,7 @@ $(obj)/%.s: $(src)/%.S FORCE · 348 unmodified lines
349quiet_cmd_as_o_S = AS $(quiet_modtag) $@349quiet_cmd_as_o_S = AS $(quiet_modtag) $@
350 cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<350 cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
351 351
352ifdef CONFIG_MODVERSIONS352ifdef CONFIG_ASM_MODVERSIONS
353
354ASM_PROTOTYPES := $(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/asm-prototypes.h)
355
356ifneq ($(ASM_PROTOTYPES),)
357 353
358# versioning matches the C process described above, with difference that354# versioning matches the C process described above, with difference that
359# we parse asm-prototypes.h C header to get function definitions.355# we parse asm-prototypes.h C header to get function definitions.
@@ -369,7 +365,6 @@ cmd_modversions_S = \ · 9 unmodified lines
369 rm -f $(@D)/.tmp_$(@F:.o=.ver); \365 rm -f $(@D)/.tmp_$(@F:.o=.ver); \
370 fi366 fi
371endif367endif
372endif
373 368
374$(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE369$(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE
375 $(call if_changed_rule,as_o_S)370 $(call if_changed_rule,as_o_S)