Skip to content

Commit

Permalink
kbuild,gcov: simplify kernel/gcov/Makefile more
Browse files Browse the repository at this point in the history
CONFIG_GCOV_FORMAT_3_4 / _4_7 / _AUTODETECT are exclusive.
Compare the CC version only when _AUTODETECT is enabled.

This change should have no impact.

Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
masahir0y authored and michal42 committed Jan 9, 2015
1 parent 6dcb4e5 commit a75f8b8
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions kernel/gcov/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"'

# if-lt
# Usage VAR := $(call if-lt, $(a), $(b))
# Returns 1 if (a < b)
if-lt = $(shell [ $(1) -lt $(2) ] && echo 1)

ifeq ($(CONFIG_GCOV_FORMAT_3_4),y)
cc-ver := 0304
else ifeq ($(CONFIG_GCOV_FORMAT_4_7),y)
cc-ver := 0407
else
cc-ver := $(cc-version)
endif

obj-y := base.o fs.o

ifeq ($(call if-lt, $(cc-ver), 0407),1)
obj-y += gcc_3_4.o
else
obj-y += gcc_4_7.o
endif
obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4.o
obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o
obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion, -lt, 0407, \
gcc_3_4.o, gcc_4_7.o)

0 comments on commit a75f8b8

Please sign in to comment.