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