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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 f.write('LOCAL_PATH:= $(call my-dir)\n') | 154 f.write('LOCAL_PATH:= $(call my-dir)\n') |
155 | 155 |
156 def write_clear_vars(f): | 156 def write_clear_vars(f): |
157 """Add the CLEAR_VARS line to the makefile. | 157 """Add the CLEAR_VARS line to the makefile. |
158 | 158 |
159 Args: | 159 Args: |
160 f: File open for writing. | 160 f: File open for writing. |
161 """ | 161 """ |
162 f.write('include $(CLEAR_VARS)\n') | 162 f.write('include $(CLEAR_VARS)\n') |
163 | 163 |
| 164 def write_include_stlport(f): |
| 165 """Add a line to include stlport. |
| 166 |
| 167 Args: |
| 168 f: File open for writing. |
| 169 """ |
| 170 f.write('include external/stlport/libstlport.mk\n') |
| 171 |
164 def write_android_mk(target_dir, common, deviations_from_common): | 172 def write_android_mk(target_dir, common, deviations_from_common): |
165 """Given all the variables, write the final make file. | 173 """Given all the variables, write the final make file. |
166 | 174 |
167 Args: | 175 Args: |
168 target_dir: The full path to the directory to write Android.mk, or None | 176 target_dir: The full path to the directory to write Android.mk, or None |
169 to use the current working directory. | 177 to use the current working directory. |
170 common: VarsDict holding variables definitions common to all | 178 common: VarsDict holding variables definitions common to all |
171 configurations. | 179 configurations. |
172 deviations_from_common: List of VarsDictData, one for each possible | 180 deviations_from_common: List of VarsDictData, one for each possible |
173 configuration. VarsDictData.name will be appended to each key before | 181 configuration. VarsDictData.name will be appended to each key before |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 226 |
219 write_local_vars(f, common, False, None) | 227 write_local_vars(f, common, False, None) |
220 | 228 |
221 for data in deviations_from_common: | 229 for data in deviations_from_common: |
222 if data.condition: | 230 if data.condition: |
223 f.write('ifeq ($(%s), true)\n' % data.condition) | 231 f.write('ifeq ($(%s), true)\n' % data.condition) |
224 write_local_vars(f, data.vars_dict, True, data.name) | 232 write_local_vars(f, data.vars_dict, True, data.name) |
225 if data.condition: | 233 if data.condition: |
226 f.write('endif\n\n') | 234 f.write('endif\n\n') |
227 | 235 |
| 236 write_include_stlport(f) |
228 f.write('include $(BUILD_SHARED_LIBRARY)\n') | 237 f.write('include $(BUILD_SHARED_LIBRARY)\n') |
229 f.write(SKIA_TOOLS) | 238 f.write(SKIA_TOOLS) |
230 | 239 |
OLD | NEW |