diff mbox series

[XEN,v7,51/51] build: add %.E targets

Message ID 20210824105038.1257926-52-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen: Build system improvements, now with out-of-tree build! | expand

Commit Message

Anthony PERARD Aug. 24, 2021, 10:50 a.m. UTC
I guess it's easier to remember that %.E does "$(CC) -E" or "$(CPP)".

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Makefile | 4 ++--
 xen/Rules.mk | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Jan Beulich Oct. 13, 2021, 3:48 p.m. UTC | #1
On 24.08.2021 12:50, Anthony PERARD wrote:
> I guess it's easier to remember that %.E does "$(CC) -E" or "$(CPP)".

I've never seen any *.E. I'm puzzled (and hence have reservations, but
then again don't care enough to object).

> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -289,6 +289,11 @@ $(obj)/%.s: $(src)/%.c FORCE
>  $(obj)/%.s: $(src)/%.S FORCE
>  	$(call if_changed_dep,cpp_s_S)
>  
> +$(obj)/%.E: $(src)/%.c FORCE
> +	$(call if_changed_dep,cpp_i_c)
> +$(obj)/%.E: $(src)/%.S FORCE
> +	$(call if_changed_dep,cpp_s_S)

It's kind of sad in this case that you can't fold these with the %.i
rules.

Besides the changes you make, don't you also need to adjust some
"clean" rule?

Jan
Jan Beulich Oct. 14, 2021, 6:52 a.m. UTC | #2
On 13.10.2021 17:48, Jan Beulich wrote:
> On 24.08.2021 12:50, Anthony PERARD wrote:
>> I guess it's easier to remember that %.E does "$(CC) -E" or "$(CPP)".
> 
> I've never seen any *.E. I'm puzzled (and hence have reservations, but
> then again don't care enough to object).

Actually I've checked gcc, and it wouldn't know what to do with a *.E
file. Hence I'd like to ask that you add a reasonable reference to a
pre-existing use of this naming. Without such reference I'd feel the
addition would have more risk of confusion than possible value.

Jan
diff mbox series

Patch

diff --git a/xen/Makefile b/xen/Makefile
index d27c213c3aa9..91b34d549970 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -586,10 +586,10 @@  cscope:
 _MAP:
 	$(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
 
-%.o %.i %.s: %.c tools_fixdep FORCE
+%.o %.i %.s %.E: %.c tools_fixdep FORCE
 	$(MAKE) $(build)=$(*D) $(*D)/$(@F)
 
-%.o %.s: %.S tools_fixdep FORCE
+%.o %.s %.E: %.S tools_fixdep FORCE
 	$(MAKE) $(build)=$(*D) $(*D)/$(@F)
 
 %/: tools_fixdep FORCE
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 6c97f539330a..7d6112a3cdec 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -289,6 +289,11 @@  $(obj)/%.s: $(src)/%.c FORCE
 $(obj)/%.s: $(src)/%.S FORCE
 	$(call if_changed_dep,cpp_s_S)
 
+$(obj)/%.E: $(src)/%.c FORCE
+	$(call if_changed_dep,cpp_i_c)
+$(obj)/%.E: $(src)/%.S FORCE
+	$(call if_changed_dep,cpp_s_S)
+
 # Linker scripts, .lds.S -> .lds
 quiet_cmd_cpp_lds_S = LDS     $@
 cmd_cpp_lds_S = $(CPP) -P $(call cpp_flags,$(a_flags)) -DLINKER_SCRIPT -MQ $@ -o $@ $<