linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools build: replace $(CC) -E with $(CPP) for pre-processing
@ 2016-12-23  4:46 Masahiro Yamada
  2016-12-23 10:59 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2016-12-23  4:46 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, Masahiro Yamada, Wang Nan, linux-kernel, Michal Marek,
	Jiri Olsa

The top-level Makefile defines:

  CPP             = $(CC) -E

So, $(CC) -E can be replaced with $(CPP) and this makes more sense
for pre-processing.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 tools/build/Makefile.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 99c0ccd..4a0ec5c 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -65,7 +65,7 @@ quiet_cmd_cxx_o_c = CXX      $@
       cmd_cxx_o_c = $(CXX) $(cxx_flags) -c -o $@ $<
 
 quiet_cmd_cpp_i_c = CPP      $@
-      cmd_cpp_i_c = $(CC) $(c_flags) -E -o $@ $<
+      cmd_cpp_i_c = $(CPP) $(c_flags) -o $@ $<
 
 quiet_cmd_cc_s_c = AS       $@
       cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools build: replace $(CC) -E with $(CPP) for pre-processing
  2016-12-23  4:46 [PATCH] tools build: replace $(CC) -E with $(CPP) for pre-processing Masahiro Yamada
@ 2016-12-23 10:59 ` Jiri Olsa
  2016-12-24  6:24   ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2016-12-23 10:59 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Wang Nan, linux-kernel,
	Michal Marek

On Fri, Dec 23, 2016 at 01:46:42PM +0900, Masahiro Yamada wrote:
> The top-level Makefile defines:
> 
>   CPP             = $(CC) -E

hum, so that'd work for running from top level, but I guess
it fails for compiling from other places..? like tools/perf

jirka

> 
> So, $(CC) -E can be replaced with $(CPP) and this makes more sense
> for pre-processing.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  tools/build/Makefile.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
> index 99c0ccd..4a0ec5c 100644
> --- a/tools/build/Makefile.build
> +++ b/tools/build/Makefile.build
> @@ -65,7 +65,7 @@ quiet_cmd_cxx_o_c = CXX      $@
>        cmd_cxx_o_c = $(CXX) $(cxx_flags) -c -o $@ $<
>  
>  quiet_cmd_cpp_i_c = CPP      $@
> -      cmd_cpp_i_c = $(CC) $(c_flags) -E -o $@ $<
> +      cmd_cpp_i_c = $(CPP) $(c_flags) -o $@ $<
>  
>  quiet_cmd_cc_s_c = AS       $@
>        cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools build: replace $(CC) -E with $(CPP) for pre-processing
  2016-12-23 10:59 ` Jiri Olsa
@ 2016-12-24  6:24   ` Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2016-12-24  6:24 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Wang Nan,
	Linux Kernel Mailing List, Michal Marek

Hi Jiri,


2016-12-23 19:59 GMT+09:00 Jiri Olsa <jolsa@redhat.com>:
> On Fri, Dec 23, 2016 at 01:46:42PM +0900, Masahiro Yamada wrote:
>> The top-level Makefile defines:
>>
>>   CPP             = $(CC) -E
>
> hum, so that'd work for running from top level, but I guess
> it fails for compiling from other places..? like tools/perf


I thought users are supposed to build tools from the top-level, but
seems it is not necessarily true
according to your statement.

I am not quite sure how CC, AS, etc. are set-up, then.
Perhaps, relying on Make-builtin variables?

$ make --print-data-base | grep CPP

showed me the default of CPP is

CPP = $(CC) -E

I guess you are more familiar to the tools-build area,
so I follow your decision.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-24  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23  4:46 [PATCH] tools build: replace $(CC) -E with $(CPP) for pre-processing Masahiro Yamada
2016-12-23 10:59 ` Jiri Olsa
2016-12-24  6:24   ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).