X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=scripts%2FMakefile.lib;h=7a7778746ea68cf12841cadfd0a84c48ab472588;hb=3530c1886291df061e3972c55590777ef1cb67f8;hp=2b706617c89a806c69b83a112f046f16046904b4;hpb=187f81b3d8d315c35c73ac0d05b15a04a0ac3ce7;p=karo-tx-linux.git diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 2b706617c89a..7a7778746ea6 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -116,6 +116,17 @@ _a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \ $(asflags-y) $(AFLAGS_$(basetarget).o) _cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) +# +# Enable gcov profiling flags for a file, directory or for all files depending +# on variables GCOV_PROFILE_obj.o, GCOV_PROFILE and CONFIG_GCOV_PROFILE_ALL +# (in this order) +# +ifeq ($(CONFIG_GCOV_KERNEL),y) +_c_flags += $(if $(patsubst n%,, \ + $(GCOV_PROFILE_$(basetarget).o)$(GCOV_PROFILE)$(CONFIG_GCOV_PROFILE_ALL)), \ + $(CFLAGS_GCOV)) +endif + # If building the kernel in a separate objtree expand all occurrences # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').