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