Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit a75f8b8

Browse files
masahir0ymichal42
authored andcommitted
kbuild,gcov: simplify kernel/gcov/Makefile more
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]>
1 parent 6dcb4e5 commit a75f8b8

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

kernel/gcov/Makefile

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
ccflags-y := -DSRCTREE='"$(srctree)"' -DOBJTREE='"$(objtree)"'
22

3-
# if-lt
4-
# Usage VAR := $(call if-lt, $(a), $(b))
5-
# Returns 1 if (a < b)
6-
if-lt = $(shell [ $(1) -lt $(2) ] && echo 1)
7-
8-
ifeq ($(CONFIG_GCOV_FORMAT_3_4),y)
9-
cc-ver := 0304
10-
else ifeq ($(CONFIG_GCOV_FORMAT_4_7),y)
11-
cc-ver := 0407
12-
else
13-
cc-ver := $(cc-version)
14-
endif
15-
163
obj-y := base.o fs.o
17-
18-
ifeq ($(call if-lt, $(cc-ver), 0407),1)
19-
obj-y += gcc_3_4.o
20-
else
21-
obj-y += gcc_4_7.o
22-
endif
4+
obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4.o
5+
obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o
6+
obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion, -lt, 0407, \
7+
gcc_3_4.o, gcc_4_7.o)

0 commit comments

Comments
 (0)