fdo.mk revision 4e8f2ea6e8bc04541e7bbd465d39e5c10177b129
1# 2# Copyright (C) 2006 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17# Setup FDO related flags. 18 19$(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS:= 20 21ifeq ($(strip $(BUILD_FDO_INSTRUMENT)), true) 22 # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation. 23 # The profile will be generated on /sdcard/fdo_profile on the device. 24 $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-generate=/sdcard/fdo_profile -DANDROID_FDO 25else 26 ifeq ($(strip $(BUILD_FDO_OPTIMIZE)), true) 27 # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build. 28 ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)),) 29 $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH := vendor/google_data/fdo_profile 30 endif 31 32 ifneq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)/$(PRODUCT_OUT))),) 33 $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-use=$($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) -DANDROID_FDO -fprofile-correction -Wcoverage-mismatch -Wno-error 34 else 35 $(warning Profile directory $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)/$(PRODUCT_OUT) does not exist. Turn off FDO.) 36 endif 37 endif 38endif 39