@@ -1513,7 +1513,7 @@ else
endif
%.s: %.c prepare scripts FORCE
- $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+ $(Q)$(MAKE) $(build)=$(build-dir) asm_target=$@ $(target-dir)$(notdir $@)
%.i: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.o: %.c prepare scripts FORCE
@@ -147,7 +147,12 @@ $(multi-objs-y:.o=.s) : modname = $(modname-multi)
$(multi-objs-y:.o=.lst) : modname = $(modname-multi)
quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
-cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
+cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -g -S -o $@ $< \
+ $(if $(findstring $(asm_target),$@),\
+ $(if $(__cmd_cc_s_c_once),,\
+ $(if $(CONFIG_READABLE_ASM),,\
+ $(warning Enable CONFIG_READABLE_ASM for more helpful asm); \
+ $(eval __cmd_cc_s_c_once=1)))) \
$(obj)/%.s: $(src)/%.c FORCE
$(call if_changed_dep,cc_s_c)