Skip to contentSkip to conversation

kbuild: support make dir/file.i for *.S

PATCH In review Wang YanQing 4 participants 7 messages Dec 10, 2015 – Dec 15, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: support make dir/file.i for *.S

This feature could reduce a little time to expand all the macros in *.S for reading.

---
 Makefile               | 2 ++
 scripts/Makefile.build | 6 ++++++
 2 files changed, 8 insertions(+)
Makefile +2 -0
index 7558c9c..d7e2060 100644
@@ -1552,6 +1552,8 @@ endif
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.s: %.S prepare scripts FORCE
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.i: %.S prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.o: %.S prepare scripts FORCE
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
scripts/Makefile.build +6 -0
index 2c47f9c..2a51d49 100644
@@ -287,6 +287,12 @@ cmd_as_s_S       = $(CPP) $(a_flags)   -o $@ $<
 $(obj)/%.s: $(src)/%.S FORCE
 	$(call if_changed_dep,as_s_S)
 
+quiet_cmd_cc_i_S = CPP $(quiet_modtag) $@
+cmd_cc_i_S       = $(CPP) $(a_flags)   -o $@ $<
+
+$(obj)/%.i: $(src)/%.S FORCE
+	$(call if_changed_dep,cc_i_S)
+
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<
 
Signature · 1 line
1.8.5.6.2.g3d8a54e.dirty
#1 lore raw

Dne 10.12.2015 v 17:33 Wang YanQing napsal(a):

Quoted 4 lines

This feature could reduce a little time to expand all the macros in *.S for reading.

Makes sense. Applied to kbuild.git#kbuild.

Michal

#2 lore raw
In reply to Wang YanQing
Quoted 28 lines · Wang YanQing

This feature could reduce a little time to expand all the macros in *.S for reading.

---
 Makefile               | 2 ++
 scripts/Makefile.build | 6 ++++++
 2 files changed, 8 insertions(+)
Makefile +2 -0
index 7558c9c..d7e2060 100644
@@ -1552,6 +1552,8 @@ endif
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.s: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.i: %.S prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.o: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
scripts/Makefile.build +0 -0
index 2c47f9c..2a51d49 100644
@@ -287,6 +287,12 @@ cmd_as_s_S       = $(CPP) $(a_flags)   -o $@ $<
 $(obj)/%.s: $(src)/%.S FORCE

scripts/Makefile.build cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< · line 297

Quoted 10 lines
scripts/Makefile.build +6 -0
        $(call if_changed_dep,as_s_S)
 
+quiet_cmd_cc_i_S = CPP $(quiet_modtag) $@
+cmd_cc_i_S       = $(CPP) $(a_flags)   -o $@ $<
+
+$(obj)/%.i: $(src)/%.S FORCE
+       $(call if_changed_dep,cc_i_S)
+
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<

*.s (lower case) is the suffix used for preprocessed assembly files, and there is already a rule for that. *.i is for preprocessed C files.

--
Brian Gerst

#3 lore raw

2015-12-13 4:13 GMT+09:00 Brian Gerst <[email protected]>:

Quoted 31 lines · Wang YanQing
Quoted 30 lines

This feature could reduce a little time to expand all the macros in *.S for reading.

---
 Makefile               | 2 ++
 scripts/Makefile.build | 6 ++++++
 2 files changed, 8 insertions(+)
Makefile +2 -0
index 7558c9c..d7e2060 100644
@@ -1552,6 +1552,8 @@ endif
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.s: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.i: %.S prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.o: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
scripts/Makefile.build +0 -0
index 2c47f9c..2a51d49 100644
@@ -287,6 +287,12 @@ cmd_as_s_S       = $(CPP) $(a_flags)   -o $@ $<
 $(obj)/%.s: $(src)/%.S FORCE
        $(call if_changed_dep,as_s_S)
 
Quoted 13 lines

scripts/Makefile.build cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< · line 297

Quoted 8 lines
scripts/Makefile.build +6 -0
+quiet_cmd_cc_i_S = CPP $(quiet_modtag) $@
+cmd_cc_i_S       = $(CPP) $(a_flags)   -o $@ $<
+
+$(obj)/%.i: $(src)/%.S FORCE
+       $(call if_changed_dep,cc_i_S)
+
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<

*.s (lower case) is the suffix used for preprocessed assembly files, and there is already a rule for that. *.i is for preprocessed C files.

Right. We already support *.s and it is completely the same as what this patch adds (except that *.i is now an alias of *.s, which is also wrong as Brian pointed out.)

quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<

$(obj)/%.s: $(src)/%.S FORCE

         $(call if_changed_dep,as_s_S)
Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw
In reply to Brian Gerst
Quoted 31 lines · Brian Gerst
Quoted 30 lines · Wang YanQing

This feature could reduce a little time to expand all the macros in *.S for reading.

---
 Makefile               | 2 ++
 scripts/Makefile.build | 6 ++++++
 2 files changed, 8 insertions(+)
Makefile +2 -0
index 7558c9c..d7e2060 100644
@@ -1552,6 +1552,8 @@ endif
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.s: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.i: %.S prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.o: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
scripts/Makefile.build +0 -0
index 2c47f9c..2a51d49 100644
@@ -287,6 +287,12 @@ cmd_as_s_S       = $(CPP) $(a_flags)   -o $@ $<
 $(obj)/%.s: $(src)/%.S FORCE
        $(call if_changed_dep,as_s_S)
 
Quoted 12 lines

scripts/Makefile.build cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< · line 297

Quoted 8 lines
scripts/Makefile.build +6 -0
+quiet_cmd_cc_i_S = CPP $(quiet_modtag) $@
+cmd_cc_i_S       = $(CPP) $(a_flags)   -o $@ $<
+
+$(obj)/%.i: $(src)/%.S FORCE
+       $(call if_changed_dep,cc_i_S)
+
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<

*.s (lower case) is the suffix used for preprocessed assembly files, and there is already a rule for that. *.i is for preprocessed C files.

Agreed, you are right!

Thanks.

#5 lore raw

Dne 14.12.2015 v 17:14 Wang YanQing napsal(a):

Quoted 45 lines · Brian Gerst
Quoted 31 lines · Wang YanQing
Quoted 30 lines

This feature could reduce a little time to expand all the macros in *.S for reading.

---
 Makefile               | 2 ++
 scripts/Makefile.build | 6 ++++++
 2 files changed, 8 insertions(+)
Makefile +2 -0
index 7558c9c..d7e2060 100644
@@ -1552,6 +1552,8 @@ endif
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.s: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.i: %.S prepare scripts FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.o: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
scripts/Makefile.build +0 -0
index 2c47f9c..2a51d49 100644
@@ -287,6 +287,12 @@ cmd_as_s_S       = $(CPP) $(a_flags)   -o $@ $<
 $(obj)/%.s: $(src)/%.S FORCE
        $(call if_changed_dep,as_s_S)
 
Quoted 12 lines

scripts/Makefile.build cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< · line 297

Quoted 8 lines
scripts/Makefile.build +6 -0
+quiet_cmd_cc_i_S = CPP $(quiet_modtag) $@
+cmd_cc_i_S       = $(CPP) $(a_flags)   -o $@ $<
+
+$(obj)/%.i: $(src)/%.S FORCE
+       $(call if_changed_dep,cc_i_S)
+
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<

*.s (lower case) is the suffix used for preprocessed assembly files, and there is already a rule for that. *.i is for preprocessed C files.

Quoted 1 line

Agreed, you are right!

Ah, I missed. I'll revert the patch in the kbuild tree.

Michal

#6 lore raw

Hi Michal,

2015-12-15 2:16 GMT+09:00 Michal Marek <[email protected]>:

Quoted 2 lines

Ah, I missed. I'll revert the patch in the kbuild tree.

Please drop the noise commit rather than reverting it.
It was just applied a few days ago, and there is only one commit on top of it.

Signature · 2 lines
Best Regards
Masahiro Yamada