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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 ) | 111 ) |
112 | 112 |
113 SKIA_TOOLS = ( | 113 SKIA_TOOLS = ( |
114 """ | 114 """ |
115 ############################################################# | 115 ############################################################# |
116 # Build the skia tools | 116 # Build the skia tools |
117 # | 117 # |
118 | 118 |
119 # benchmark (timings) | 119 # benchmark (timings) |
120 include $(BASE_PATH)/bench/Android.mk | 120 include $(BASE_PATH)/bench/Android.mk |
| 121 include $(BASE_PATH)/tools/Android.mk |
121 | 122 |
122 # golden-master (fidelity / regression test) | 123 # golden-master (fidelity / regression test) |
123 include $(BASE_PATH)/gm/Android.mk | 124 include $(BASE_PATH)/gm/Android.mk |
124 | 125 |
125 # unit-tests | 126 # unit-tests |
126 include $(BASE_PATH)/tests/Android.mk | 127 include $(BASE_PATH)/tests/Android.mk |
127 | 128 |
128 # diamond-master (one test to rule them all) | 129 # diamond-master (one test to rule them all) |
129 include $(BASE_PATH)/dm/Android.mk | 130 include $(BASE_PATH)/dm/Android.mk |
130 """ | 131 """ |
(...skipping 11 matching lines...) Expand all Loading... |
142 name: Name associated with the VarsDict. Can be accessed via | 143 name: Name associated with the VarsDict. Can be accessed via |
143 self.name. | 144 self.name. |
144 condition: Optional string representing a condition. If not None, | 145 condition: Optional string representing a condition. If not None, |
145 used to create a conditional inside the makefile. | 146 used to create a conditional inside the makefile. |
146 """ | 147 """ |
147 self.vars_dict = vars_dict | 148 self.vars_dict = vars_dict |
148 self.condition = condition | 149 self.condition = condition |
149 self.name = name | 150 self.name = name |
150 | 151 |
151 def write_local_path(f): | 152 def write_local_path(f): |
152 """Add the LOCAL_PATH line to the makefile. | 153 """Add the LOCAL_PATH line to the makefile. |
153 | 154 |
154 Args: | 155 Args: |
155 f: File open for writing. | 156 f: File open for writing. |
156 """ | 157 """ |
157 f.write('LOCAL_PATH:= $(call my-dir)\n') | 158 f.write('LOCAL_PATH:= $(call my-dir)\n') |
158 | 159 |
159 def write_clear_vars(f): | 160 def write_clear_vars(f): |
160 """Add the CLEAR_VARS line to the makefile. | 161 """Add the CLEAR_VARS line to the makefile. |
161 | 162 |
162 Args: | 163 Args: |
163 f: File open for writing. | 164 f: File open for writing. |
164 """ | 165 """ |
165 f.write('include $(CLEAR_VARS)\n') | 166 f.write('include $(CLEAR_VARS)\n') |
166 | 167 |
167 def write_include_stlport(f): | 168 def write_include_stlport(f): |
168 """Add a line to include stlport. | 169 """Add a line to include stlport. |
169 | 170 |
170 Args: | 171 Args: |
171 f: File open for writing. | 172 f: File open for writing. |
172 """ | 173 """ |
173 f.write('include external/stlport/libstlport.mk\n') | 174 f.write('include external/stlport/libstlport.mk\n') |
174 | 175 |
175 def write_android_mk(target_dir, common, deviations_from_common): | 176 def write_android_mk(target_dir, common, deviations_from_common): |
176 """Given all the variables, write the final make file. | 177 """Given all the variables, write the final make file. |
177 | 178 |
178 Args: | 179 Args: |
179 target_dir: The full path to the directory to write Android.mk, or None | 180 target_dir: The full path to the directory to write Android.mk, or None |
180 to use the current working directory. | 181 to use the current working directory. |
181 common: VarsDict holding variables definitions common to all | 182 common: VarsDict holding variables definitions common to all |
182 configurations. | 183 configurations. |
183 deviations_from_common: List of VarsDictData, one for each possible | 184 deviations_from_common: List of VarsDictData, one for each possible |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if data.condition: | 225 if data.condition: |
225 f.write('ifeq ($(%s), true)\n' % data.condition) | 226 f.write('ifeq ($(%s), true)\n' % data.condition) |
226 write_local_vars(f, data.vars_dict, True, data.name) | 227 write_local_vars(f, data.vars_dict, True, data.name) |
227 if data.condition: | 228 if data.condition: |
228 f.write('endif\n\n') | 229 f.write('endif\n\n') |
229 | 230 |
230 write_include_stlport(f) | 231 write_include_stlport(f) |
231 f.write('include $(BUILD_SHARED_LIBRARY)\n') | 232 f.write('include $(BUILD_SHARED_LIBRARY)\n') |
232 f.write(SKIA_TOOLS) | 233 f.write(SKIA_TOOLS) |
233 | 234 |
OLD | NEW |