Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 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 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 17 | ifndef ART_ANDROID_COMMON_BUILD_MK |
| 18 | ART_ANDROID_COMMON_BUILD_MK = true |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 19 | |
| 20 | include art/build/Android.common.mk |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 21 | include art/build/Android.common_utils.mk |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 22 | |
| 23 | # These can be overridden via the environment or by editing to |
| 24 | # enable/disable certain build configuration. |
| 25 | # |
| 26 | # For example, to disable everything but the host debug build you use: |
| 27 | # |
| 28 | # (export ART_BUILD_TARGET_NDEBUG=false && export ART_BUILD_TARGET_DEBUG=false && export ART_BUILD_HOST_NDEBUG=false && ...) |
| 29 | # |
| 30 | # Beware that tests may use the non-debug build for performance, notable 055-enum-performance |
| 31 | # |
| 32 | ART_BUILD_TARGET_NDEBUG ?= true |
| 33 | ART_BUILD_TARGET_DEBUG ?= true |
| 34 | ART_BUILD_HOST_NDEBUG ?= true |
| 35 | ART_BUILD_HOST_DEBUG ?= true |
| 36 | |
| 37 | ifeq ($(ART_BUILD_TARGET_NDEBUG),false) |
| 38 | $(info Disabling ART_BUILD_TARGET_NDEBUG) |
| 39 | endif |
| 40 | ifeq ($(ART_BUILD_TARGET_DEBUG),false) |
| 41 | $(info Disabling ART_BUILD_TARGET_DEBUG) |
| 42 | endif |
| 43 | ifeq ($(ART_BUILD_HOST_NDEBUG),false) |
| 44 | $(info Disabling ART_BUILD_HOST_NDEBUG) |
| 45 | endif |
| 46 | ifeq ($(ART_BUILD_HOST_DEBUG),false) |
| 47 | $(info Disabling ART_BUILD_HOST_DEBUG) |
| 48 | endif |
| 49 | |
| 50 | # |
| 51 | # Used to enable smart mode |
| 52 | # |
| 53 | ART_SMALL_MODE := false |
| 54 | ifneq ($(wildcard art/SMALL_ART),) |
| 55 | $(info Enabling ART_SMALL_MODE because of existence of art/SMALL_ART) |
| 56 | ART_SMALL_MODE := true |
| 57 | endif |
| 58 | ifeq ($(WITH_ART_SMALL_MODE), true) |
| 59 | ART_SMALL_MODE := true |
| 60 | endif |
| 61 | |
| 62 | # |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 63 | # Used to change the default GC. Valid values are CMS, SS, GSS. The default is CMS. |
| 64 | # |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 65 | art_default_gc_type ?= CMS |
| 66 | art_default_gc_type_cflags := -DART_DEFAULT_GC_TYPE_IS_$(art_default_gc_type) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 67 | |
Andreas Gampe | ee0ebc8 | 2014-10-21 21:07:28 -0700 | [diff] [blame] | 68 | ART_HOST_CFLAGS := |
| 69 | ART_TARGET_CFLAGS := |
| 70 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 71 | # Clang build support. |
| 72 | |
| 73 | # Host. |
| 74 | ART_HOST_CLANG := false |
| 75 | ifneq ($(WITHOUT_HOST_CLANG),true) |
| 76 | # By default, host builds use clang for better warnings. |
| 77 | ART_HOST_CLANG := true |
| 78 | endif |
| 79 | |
Sebastien Hertz | ea521dc | 2014-06-25 18:50:01 +0200 | [diff] [blame] | 80 | # Clang on the target. Target builds use GCC by default. |
Bernhard Rosenkraenzer | 88c0569 | 2014-10-04 19:02:06 +0200 | [diff] [blame] | 81 | ifneq ($(USE_CLANG_PLATFORM_BUILD),) |
| 82 | ART_TARGET_CLANG := $(USE_CLANG_PLATFORM_BUILD) |
| 83 | else |
Ian Rogers | d642a91 | 2014-10-02 09:41:44 -0700 | [diff] [blame] | 84 | ART_TARGET_CLANG := false |
Bernhard Rosenkraenzer | 88c0569 | 2014-10-04 19:02:06 +0200 | [diff] [blame] | 85 | endif |
Chih-Hung Hsieh | 86bb22e | 2014-12-18 19:25:50 -0800 | [diff] [blame] | 86 | |
Andreas Gampe | 89866b7 | 2015-01-13 18:12:36 -0800 | [diff] [blame] | 87 | ifeq ($(TARGET_ARCH)|$(ART_TARGET_CLANG),mips|true) |
Chih-Hung Hsieh | 86bb22e | 2014-12-18 19:25:50 -0800 | [diff] [blame] | 88 | # b/18807290, Clang generated mips assembly code for array.cc |
| 89 | # cannot be compiled by gas. |
| 90 | # b/18789639, Clang assembler cannot compile inlined assembly code in |
| 91 | # valgrind_malloc_space-inl.h:192:5: error: used $at without ".set noat" |
| 92 | $(warning Clang is disabled for the mips target) |
| 93 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 94 | ART_TARGET_CLANG_arm := |
Sebastien Hertz | ea521dc | 2014-06-25 18:50:01 +0200 | [diff] [blame] | 95 | ART_TARGET_CLANG_arm64 := |
Chih-Hung Hsieh | 86bb22e | 2014-12-18 19:25:50 -0800 | [diff] [blame] | 96 | # TODO: Enable clang mips when b/18807290 and b/18789639 are fixed. |
| 97 | ART_TARGET_CLANG_mips := false |
Andreas Gampe | 1a5c406 | 2015-01-15 12:10:47 -0800 | [diff] [blame^] | 98 | ART_TARGET_CLANG_mips64 := false |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 99 | ART_TARGET_CLANG_x86 := |
| 100 | ART_TARGET_CLANG_x86_64 := |
| 101 | |
| 102 | define set-target-local-clang-vars |
| 103 | LOCAL_CLANG := $(ART_TARGET_CLANG) |
| 104 | $(foreach arch,$(ART_TARGET_SUPPORTED_ARCH), |
| 105 | ifneq ($$(ART_TARGET_CLANG_$(arch)),) |
| 106 | LOCAL_CLANG_$(arch) := $$(ART_TARGET_CLANG_$(arch)) |
| 107 | endif) |
| 108 | endef |
| 109 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 110 | ART_TARGET_CLANG_CFLAGS := |
| 111 | ART_TARGET_CLANG_CFLAGS_arm := |
| 112 | ART_TARGET_CLANG_CFLAGS_arm64 := |
| 113 | ART_TARGET_CLANG_CFLAGS_mips := |
Andreas Gampe | 1a5c406 | 2015-01-15 12:10:47 -0800 | [diff] [blame^] | 114 | ART_TARGET_CLANG_CFLAGS_mips64 := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 115 | ART_TARGET_CLANG_CFLAGS_x86 := |
| 116 | ART_TARGET_CLANG_CFLAGS_x86_64 := |
| 117 | |
Ian Rogers | d642a91 | 2014-10-02 09:41:44 -0700 | [diff] [blame] | 118 | # These are necessary for Clang ARM64 ART builds. TODO: remove. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 119 | ART_TARGET_CLANG_CFLAGS_arm64 += \ |
| 120 | -Wno-implicit-exception-spec-mismatch \ |
| 121 | -DNVALGRIND \ |
| 122 | -Wno-unused-value |
| 123 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 124 | # FIXME: upstream LLVM has a vectorizer bug that needs to be fixed |
| 125 | ART_TARGET_CLANG_CFLAGS_arm64 += \ |
| 126 | -fno-vectorize |
| 127 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 128 | # Warn about thread safety violations with clang. |
Dan Albert | 6c7cdc5 | 2014-12-02 14:58:06 -0800 | [diff] [blame] | 129 | art_clang_cflags := -Wthread-safety |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 130 | |
| 131 | # Warn if switch fallthroughs aren't annotated. |
| 132 | art_clang_cflags += -Wimplicit-fallthrough |
| 133 | |
| 134 | # Enable float equality warnings. |
| 135 | art_clang_cflags += -Wfloat-equal |
| 136 | |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 137 | # Enable warning of converting ints to void*. |
| 138 | art_clang_cflags += -Wint-to-void-pointer-cast |
| 139 | |
| 140 | # GCC-only warnings. |
| 141 | art_gcc_cflags := -Wunused-but-set-parameter |
| 142 | # Suggest const: too many false positives, but good for a trial run. |
| 143 | # -Wsuggest-attribute=const |
| 144 | # Useless casts: too many, as we need to be 32/64 agnostic, but the compiler knows. |
| 145 | # -Wuseless-cast |
| 146 | # Zero-as-null: Have to convert all NULL and "diagnostic ignore" all includes like libnativehelper |
| 147 | # that are still stuck pre-C++11. |
| 148 | # -Wzero-as-null-pointer-constant \ |
| 149 | # Suggest final: Have to move to a more recent GCC. |
| 150 | # -Wsuggest-final-types |
| 151 | |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 152 | ART_TARGET_CLANG_CFLAGS := $(art_clang_cflags) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 153 | ifeq ($(ART_HOST_CLANG),true) |
Ian Rogers | 4ad5cd3 | 2014-11-11 23:08:07 -0800 | [diff] [blame] | 154 | # Bug: 15446488. We don't omit the frame pointer to work around |
| 155 | # clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress. |
| 156 | ART_HOST_CFLAGS += $(art_clang_cflags) -fno-omit-frame-pointer |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 157 | else |
| 158 | ART_HOST_CFLAGS += $(art_gcc_cflags) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 159 | endif |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 160 | ifneq ($(ART_TARGET_CLANG),true) |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 161 | ART_TARGET_CFLAGS += $(art_gcc_cflags) |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 162 | else |
| 163 | # TODO: if we ever want to support GCC/Clang mix for multi-target products, this needs to be |
| 164 | # split up. |
| 165 | ifeq ($(ART_TARGET_CLANG_$(TARGET_ARCH)),false) |
| 166 | ART_TARGET_CFLAGS += $(art_gcc_cflags) |
| 167 | endif |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 168 | endif |
| 169 | |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 170 | # Clear local variables now their use has ended. |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 171 | art_clang_cflags := |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 172 | art_gcc_cflags := |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 173 | |
| 174 | ART_CPP_EXTENSION := .cc |
| 175 | |
| 176 | ART_C_INCLUDES := \ |
| 177 | external/gtest/include \ |
| 178 | external/valgrind/main/include \ |
| 179 | external/valgrind/main \ |
| 180 | external/vixl/src \ |
| 181 | external/zlib \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 182 | |
| 183 | # Base set of cflags used by all things ART. |
| 184 | art_cflags := \ |
| 185 | -fno-rtti \ |
| 186 | -std=gnu++11 \ |
| 187 | -ggdb3 \ |
| 188 | -Wall \ |
| 189 | -Werror \ |
| 190 | -Wextra \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 191 | -Wstrict-aliasing \ |
| 192 | -fstrict-aliasing \ |
| 193 | -Wunreachable-code \ |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 194 | -Wno-conversion-null \ |
| 195 | -Wredundant-decls \ |
| 196 | -Wshadow \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 197 | -fvisibility=protected \ |
| 198 | $(art_default_gc_type_cflags) |
| 199 | |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 200 | # Missing declarations: too many at the moment, as we use "extern" quite a bit. |
| 201 | # -Wmissing-declarations \ |
| 202 | |
| 203 | |
Mathieu Chartier | cd195fe | 2014-11-25 18:36:01 -0800 | [diff] [blame] | 204 | |
| 205 | ifdef ART_IMT_SIZE |
| 206 | art_cflags += -DIMT_SIZE=$(ART_IMT_SIZE) |
| 207 | else |
| 208 | # Default is 64 |
| 209 | art_cflags += -DIMT_SIZE=64 |
| 210 | endif |
| 211 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 212 | ifeq ($(ART_SMALL_MODE),true) |
| 213 | art_cflags += -DART_SMALL_MODE=1 |
| 214 | endif |
| 215 | |
Nicolas Geoffray | 9bb492a | 2014-11-25 23:42:00 +0000 | [diff] [blame] | 216 | ifeq ($(ART_USE_OPTIMIZING_COMPILER),true) |
| 217 | art_cflags += -DART_USE_OPTIMIZING_COMPILER=1 |
| 218 | endif |
| 219 | |
Hiroshi Yamauchi | b0d22f1 | 2014-12-08 12:08:46 -0800 | [diff] [blame] | 220 | ifeq ($(ART_HEAP_POISONING),true) |
| 221 | art_cflags += -DART_HEAP_POISONING=1 |
| 222 | endif |
| 223 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 224 | # Cflags for non-debug ART and ART tools. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 225 | art_non_debug_cflags := \ |
| 226 | -O3 |
| 227 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 228 | # Cflags for debug ART and ART tools. |
| 229 | art_debug_cflags := \ |
| 230 | -O2 \ |
| 231 | -DDYNAMIC_ANNOTATIONS_ENABLED=1 \ |
Serban Constantinescu | 32f5b4d | 2014-11-25 20:05:46 +0000 | [diff] [blame] | 232 | -DVIXL_DEBUG \ |
Ian Rogers | 50fe6da | 2014-10-17 01:18:08 -0700 | [diff] [blame] | 233 | -UNDEBUG |
Stephen Hines | 67a4338 | 2014-07-17 01:49:18 -0700 | [diff] [blame] | 234 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 235 | art_host_non_debug_cflags := $(art_non_debug_cflags) |
| 236 | art_target_non_debug_cflags := $(art_non_debug_cflags) |
Stephen Hines | 67a4338 | 2014-07-17 01:49:18 -0700 | [diff] [blame] | 237 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 238 | ifeq ($(HOST_OS),linux) |
Stephen Hines | 67a4338 | 2014-07-17 01:49:18 -0700 | [diff] [blame] | 239 | # Larger frame-size for host clang builds today |
Dan Albert | 98b8bcf | 2014-11-14 19:56:21 -0800 | [diff] [blame] | 240 | ifndef SANITIZE_HOST |
Mathieu Chartier | 88f21ca | 2014-11-18 14:13:58 -0800 | [diff] [blame] | 241 | art_host_non_debug_cflags += -Wframe-larger-than=2700 |
Dan Albert | 98b8bcf | 2014-11-14 19:56:21 -0800 | [diff] [blame] | 242 | endif |
Stephen Hines | 67a4338 | 2014-07-17 01:49:18 -0700 | [diff] [blame] | 243 | art_target_non_debug_cflags += -Wframe-larger-than=1728 |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 244 | endif |
| 245 | |
Ying Wang | a28ff0f | 2014-12-08 14:29:34 -0800 | [diff] [blame] | 246 | ifndef LIBART_IMG_HOST_BASE_ADDRESS |
| 247 | $(error LIBART_IMG_HOST_BASE_ADDRESS unset) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 248 | endif |
Ying Wang | a28ff0f | 2014-12-08 14:29:34 -0800 | [diff] [blame] | 249 | ART_HOST_CFLAGS += $(art_cflags) -DART_BASE_ADDRESS=$(LIBART_IMG_HOST_BASE_ADDRESS) |
| 250 | ART_HOST_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES=default |
| 251 | |
| 252 | ifndef LIBART_IMG_TARGET_BASE_ADDRESS |
| 253 | $(error LIBART_IMG_TARGET_BASE_ADDRESS unset) |
| 254 | endif |
| 255 | ART_TARGET_CFLAGS += $(art_cflags) -DART_TARGET -DART_BASE_ADDRESS=$(LIBART_IMG_TARGET_BASE_ADDRESS) |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 256 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 257 | ART_HOST_NON_DEBUG_CFLAGS := $(art_host_non_debug_cflags) |
| 258 | ART_TARGET_NON_DEBUG_CFLAGS := $(art_target_non_debug_cflags) |
| 259 | ART_HOST_DEBUG_CFLAGS := $(art_debug_cflags) |
| 260 | ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags) |
| 261 | |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 262 | ifndef LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA |
| 263 | LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA=-0x1000000 |
| 264 | endif |
| 265 | ifndef LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA |
| 266 | LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA=0x1000000 |
| 267 | endif |
| 268 | ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA) |
| 269 | ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA) |
| 270 | |
| 271 | ifndef LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA |
| 272 | LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA=-0x1000000 |
| 273 | endif |
| 274 | ifndef LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA |
| 275 | LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA=0x1000000 |
| 276 | endif |
| 277 | ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA) |
| 278 | ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA) |
| 279 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 280 | # To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16" |
| 281 | # ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs |
| 282 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 283 | # Clear locals now they've served their purpose. |
| 284 | art_cflags := |
| 285 | art_debug_cflags := |
| 286 | art_non_debug_cflags := |
| 287 | art_host_non_debug_cflags := |
| 288 | art_target_non_debug_cflags := |
| 289 | art_default_gc_type := |
| 290 | art_default_gc_type_cflags := |
| 291 | |
| 292 | ART_HOST_LDLIBS := |
| 293 | ifneq ($(ART_HOST_CLANG),true) |
| 294 | # GCC lacks libc++ assumed atomic operations, grab via libatomic. |
| 295 | ART_HOST_LDLIBS += -latomic |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 296 | endif |
| 297 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 298 | ART_TARGET_LDFLAGS := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 299 | |
| 300 | # $(1): ndebug_or_debug |
| 301 | define set-target-local-cflags-vars |
| 302 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
| 303 | LOCAL_CFLAGS_x86 += $(ART_TARGET_CFLAGS_x86) |
Dehao Chen | 997660d | 2014-07-08 10:00:56 -0700 | [diff] [blame] | 304 | LOCAL_LDFLAGS += $(ART_TARGET_LDFLAGS) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 305 | art_target_cflags_ndebug_or_debug := $(1) |
| 306 | ifeq ($$(art_target_cflags_ndebug_or_debug),debug) |
| 307 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 308 | else |
| 309 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 310 | endif |
| 311 | |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 312 | LOCAL_CLANG_CFLAGS := $(ART_TARGET_CLANG_CFLAGS) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 313 | $(foreach arch,$(ART_SUPPORTED_ARCH), |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 314 | LOCAL_CLANG_CFLAGS_$(arch) += $$(ART_TARGET_CLANG_CFLAGS_$(arch))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 315 | |
| 316 | # Clear locally used variables. |
| 317 | art_target_cflags_ndebug_or_debug := |
| 318 | endef |
| 319 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 320 | # Support for disabling certain builds. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 321 | ART_BUILD_TARGET := false |
| 322 | ART_BUILD_HOST := false |
| 323 | ART_BUILD_NDEBUG := false |
| 324 | ART_BUILD_DEBUG := false |
| 325 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 326 | ART_BUILD_TARGET := true |
| 327 | ART_BUILD_NDEBUG := true |
| 328 | endif |
| 329 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
| 330 | ART_BUILD_TARGET := true |
| 331 | ART_BUILD_DEBUG := true |
| 332 | endif |
| 333 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
| 334 | ART_BUILD_HOST := true |
| 335 | ART_BUILD_NDEBUG := true |
| 336 | endif |
| 337 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
| 338 | ART_BUILD_HOST := true |
| 339 | ART_BUILD_DEBUG := true |
| 340 | endif |
| 341 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 342 | endif # ART_ANDROID_COMMON_BUILD_MK |