diff mbox

Generate .op pattern rules for profiling builds only

Message ID 20160920104906.8A539439929AA@oldenburg.str.redhat.com
State New
Headers show

Commit Message

Florian Weimer Sept. 20, 2016, 10:49 a.m. UTC
.op pattern rules are not used in non-profiling builds.

This does not cause any changes to both profiling and non-profiling
builds.

2016-09-20  Florian Weimer  <fweimer@redhat.com>

	* Makeconfig (all-object-suffixes): Include .op only if
	$(build-profile).

Comments

Carlos O'Donell Sept. 20, 2016, 4:01 p.m. UTC | #1
On 09/20/2016 06:49 AM, Florian Weimer wrote:
> .op pattern rules are not used in non-profiling builds.
> 
> This does not cause any changes to both profiling and non-profiling
> builds.
> 
> 2016-09-20  Florian Weimer  <fweimer@redhat.com>
> 
> 	* Makeconfig (all-object-suffixes): Include .op only if
> 	$(build-profile).

This looks good to me. I reviewed the uses of build-profile,
and profile, and verified this change looks correct.
 
> diff --git a/Makeconfig b/Makeconfig
> index c1ce74b..a785860 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -905,7 +905,8 @@ endif
>  # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
>  # to pass different flags for each flavor.
>  libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
> -all-object-suffixes := .o .os .op .oS
> +# .op may be added to all-object-suffixes below.
> +all-object-suffixes := .o .os .oS
>  object-suffixes :=
>  CPPFLAGS-.o = $(pic-default)
>  CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
> @@ -930,6 +931,7 @@ PIE-ccflag = -fPIE
>  ifeq (yes,$(build-profile))
>  # Under --enable-profile, we will build a static library of profiled objects.
>  # The profiled object files are named foo.op.
> +all-object-suffixes += .op
>  object-suffixes += .op
>  CPPFLAGS-.op = -DPROF $(pic-default)
>  CFLAGS-.op = -pg
>
diff mbox

Patch

diff --git a/Makeconfig b/Makeconfig
index c1ce74b..a785860 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -905,7 +905,8 @@  endif
 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
 # to pass different flags for each flavor.
 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
-all-object-suffixes := .o .os .op .oS
+# .op may be added to all-object-suffixes below.
+all-object-suffixes := .o .os .oS
 object-suffixes :=
 CPPFLAGS-.o = $(pic-default)
 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
@@ -930,6 +931,7 @@  PIE-ccflag = -fPIE
 ifeq (yes,$(build-profile))
 # Under --enable-profile, we will build a static library of profiled objects.
 # The profiled object files are named foo.op.
+all-object-suffixes += .op
 object-suffixes += .op
 CPPFLAGS-.op = -DPROF $(pic-default)
 CFLAGS-.op = -pg