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