| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 def write_local_vars(f, var_dict, append, name): | 39 def write_local_vars(f, var_dict, append, name): |
| 40 """ | 40 """ |
| 41 Helper function to write all the members of var_dict to the makefile. | 41 Helper function to write all the members of var_dict to the makefile. |
| 42 @param f File open for writing (Android.mk) | 42 @param f File open for writing (Android.mk) |
| 43 @param var_dict VarsDict holding the unique values for one configuration. | 43 @param var_dict VarsDict holding the unique values for one configuration. |
| 44 @param append Whether to append to each makefile variable or overwrite it. | 44 @param append Whether to append to each makefile variable or overwrite it. |
| 45 @param name If not None, a string to be appended to each key. | 45 @param name If not None, a string to be appended to each key. |
| 46 """ | 46 """ |
| 47 for key in var_dict.keys(): | 47 for key in var_dict.keys(): |
| 48 _key = key |
| 49 _items = var_dict[key] |
| 48 if key == 'LOCAL_CFLAGS': | 50 if key == 'LOCAL_CFLAGS': |
| 49 # Always append LOCAL_CFLAGS. This allows us to define some early on in | 51 # Always append LOCAL_CFLAGS. This allows us to define some early on in |
| 50 # the makefile and not overwrite them. | 52 # the makefile and not overwrite them. |
| 51 _append = True | 53 _append = True |
| 54 elif key == 'DEFINES': |
| 55 # For DEFINES, we want to append to LOCAL_CFLAGS. |
| 56 _append = True |
| 57 _key = 'LOCAL_CFLAGS' |
| 58 _items_with_D = [] |
| 59 for define in _items: |
| 60 _items_with_D.append('-D' + define) |
| 61 _items = _items_with_D |
| 52 elif key == 'KNOWN_TARGETS': | 62 elif key == 'KNOWN_TARGETS': |
| 53 # KNOWN_TARGETS are not needed in the final make file. | 63 # KNOWN_TARGETS are not needed in the final make file. |
| 54 continue | 64 continue |
| 55 else: | 65 else: |
| 56 _append = append | 66 _append = append |
| 57 _key = key | |
| 58 if name: | 67 if name: |
| 59 _key += '_' + name | 68 _key += '_' + name |
| 60 write_group(f, _key, var_dict[key], _append) | 69 write_group(f, _key, _items, _append) |
| 61 | 70 |
| 62 | 71 |
| 63 AUTOGEN_WARNING = ( | 72 AUTOGEN_WARNING = ( |
| 64 """ | 73 """ |
| 65 ############################################################################### | 74 ############################################################################### |
| 66 # | 75 # |
| 67 # THIS FILE IS AUTOGENERATED BY GYP_TO_ANDROID.PY. DO NOT EDIT. | 76 # THIS FILE IS AUTOGENERATED BY GYP_TO_ANDROID.PY. DO NOT EDIT. |
| 68 # | 77 # |
| 69 ############################################################################### | 78 ############################################################################### |
| 70 | 79 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 f.write('\tLOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE\n') | 189 f.write('\tLOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE\n') |
| 181 f.write('endif\n\n') | 190 f.write('endif\n\n') |
| 182 | 191 |
| 183 f.write('# used for testing\n') | 192 f.write('# used for testing\n') |
| 184 f.write('#LOCAL_CFLAGS += -g -O0\n\n') | 193 f.write('#LOCAL_CFLAGS += -g -O0\n\n') |
| 185 | 194 |
| 186 f.write('ifeq ($(NO_FALLBACK_FONT),true)\n') | 195 f.write('ifeq ($(NO_FALLBACK_FONT),true)\n') |
| 187 f.write('\tLOCAL_CFLAGS += -DNO_FALLBACK_FONT\n') | 196 f.write('\tLOCAL_CFLAGS += -DNO_FALLBACK_FONT\n') |
| 188 f.write('endif\n\n') | 197 f.write('endif\n\n') |
| 189 | 198 |
| 199 f.write('ifeq ($(TARGET_ARCH),arm64)\n') |
| 200 f.write(' $(warning TODOArm64: Unlike arm32, arm64 has no inline' |
| 201 ' assembly for performance critical code.)\n') |
| 202 f.write('endif\n\n') |
| 203 |
| 190 write_local_vars(f, common, False, None) | 204 write_local_vars(f, common, False, None) |
| 191 | 205 |
| 192 for data in deviations_from_common: | 206 for data in deviations_from_common: |
| 193 if data.condition: | 207 if data.condition: |
| 194 f.write('ifeq ($(%s), true)\n' % data.condition) | 208 f.write('ifeq ($(%s), true)\n' % data.condition) |
| 195 write_local_vars(f, data.vars_dict, True, data.name) | 209 write_local_vars(f, data.vars_dict, True, data.name) |
| 196 if data.condition: | 210 if data.condition: |
| 197 f.write('endif\n\n') | 211 f.write('endif\n\n') |
| 198 | 212 |
| 199 f.write('include external/stlport/libstlport.mk\n') | 213 f.write('include external/stlport/libstlport.mk\n') |
| 200 f.write('LOCAL_MODULE:= libskia\n') | 214 f.write('LOCAL_MODULE:= libskia\n') |
| 201 f.write('include $(BUILD_SHARED_LIBRARY)\n') | 215 f.write('include $(BUILD_SHARED_LIBRARY)\n') |
| 202 f.write(SKIA_TOOLS) | 216 f.write(SKIA_TOOLS) |
| 203 | 217 |
| OLD | NEW |