OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 """ | 8 """ |
9 Functions for creating an Android.mk from already created dictionaries. | 9 Functions for creating an Android.mk from already created dictionaries. |
10 """ | 10 """ |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 if target_dir: | 187 if target_dir: |
188 target_file = os.path.join(target_dir, target_file) | 188 target_file = os.path.join(target_dir, target_file) |
189 with open(target_file, 'w') as f: | 189 with open(target_file, 'w') as f: |
190 f.write(AUTOGEN_WARNING) | 190 f.write(AUTOGEN_WARNING) |
191 f.write('BASE_PATH := $(call my-dir)\n') | 191 f.write('BASE_PATH := $(call my-dir)\n') |
192 write_local_path(f) | 192 write_local_path(f) |
193 | 193 |
194 f.write(DEBUGGING_HELP) | 194 f.write(DEBUGGING_HELP) |
195 | 195 |
196 write_clear_vars(f) | 196 write_clear_vars(f) |
| 197 |
| 198 # need flags to enable feedback driven optimization (FDO) when requested |
| 199 # by the build system. |
197 f.write('LOCAL_FDO_SUPPORT := true\n') | 200 f.write('LOCAL_FDO_SUPPORT := true\n') |
| 201 f.write( |
| 202 'ifneq ($(strip $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_CFLAGS)),)\n') |
| 203 f.write('\t# This should be the last -Oxxx specified in LOCAL_CFLAGS\n') |
| 204 f.write('\tLOCAL_CFLAGS += -O2\n') |
| 205 f.write('endif\n\n') |
| 206 |
198 f.write('LOCAL_ARM_MODE := thumb\n') | 207 f.write('LOCAL_ARM_MODE := thumb\n') |
199 | 208 |
200 # need a flag to tell the C side when we're on devices with large memory | 209 # need a flag to tell the C side when we're on devices with large memory |
201 # budgets (i.e. larger than the low-end devices that initially shipped) | 210 # budgets (i.e. larger than the low-end devices that initially shipped) |
202 # On arm, only define the flag if it has VFP. For all other architectures, | 211 # On arm, only define the flag if it has VFP. For all other architectures, |
203 # always define the flag. | 212 # always define the flag. |
204 f.write('ifeq ($(TARGET_ARCH),arm)\n') | 213 f.write('ifeq ($(TARGET_ARCH),arm)\n') |
205 f.write('\tifeq ($(ARCH_ARM_HAVE_VFP),true)\n') | 214 f.write('\tifeq ($(ARCH_ARM_HAVE_VFP),true)\n') |
206 f.write('\t\tLOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE\n') | 215 f.write('\t\tLOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE\n') |
207 f.write('\tendif\n') | 216 f.write('\tendif\n') |
(...skipping 14 matching lines...) Expand all Loading... |
222 if data.condition: | 231 if data.condition: |
223 f.write('ifeq ($(%s), true)\n' % data.condition) | 232 f.write('ifeq ($(%s), true)\n' % data.condition) |
224 write_local_vars(f, data.vars_dict, True, data.name) | 233 write_local_vars(f, data.vars_dict, True, data.name) |
225 if data.condition: | 234 if data.condition: |
226 f.write('endif\n\n') | 235 f.write('endif\n\n') |
227 | 236 |
228 write_include_stlport(f) | 237 write_include_stlport(f) |
229 f.write('include $(BUILD_SHARED_LIBRARY)\n') | 238 f.write('include $(BUILD_SHARED_LIBRARY)\n') |
230 f.write(SKIA_TOOLS) | 239 f.write(SKIA_TOOLS) |
231 | 240 |
OLD | NEW |