diff options
author | Jiri Olsa <jolsa@kernel.org> | 2016-11-02 14:35:47 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-14 15:37:25 +0100 |
commit | 2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b (patch) | |
tree | a16750cef61a1b5449b1814c95e76aab88b2aeb5 /tools/build/Build.include | |
parent | perf intel-pt: Update documentation about context switch events (diff) | |
download | linux-2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b.tar.xz linux-2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b.zip |
tools build: Add CFLAGS_REMOVE_* support
Adding support to remove options from final CFLAGS for both object file
and build target. It's now possible to remove CFLAGS options like:
CFLAGS_REMOVE_krava.o += -Wstrict-prototypes
Committer notes:
This comes from the kernel's kbuild infrastructure, the subset that is
supported in tools/ is being documented at tools/build/Documentation/Build.txt.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: William Cohen <wcohen@redhat.com>
Link: http://lkml.kernel.org/r/1478093749-5602-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/build/Build.include')
-rw-r--r-- | tools/build/Build.include | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/build/Build.include b/tools/build/Build.include index 1dcb95e76f70..c4ae12a5d0a5 100644 --- a/tools/build/Build.include +++ b/tools/build/Build.include @@ -89,7 +89,9 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1)) +c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2)) cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) ### |