blob: acc693af28923052966e9ca0c76677022012ee7c [file] [log] [blame]
Adam Langley9e1a6602015-05-05 17:47:53 -07001# Copyright (c) 2015, Google Inc.
2#
3# Permission to use, copy, modify, and/or distribute this software for any
4# purpose with or without fee is hereby granted, provided that the above
5# copyright notice and this permission notice appear in all copies.
6#
7# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14
15"""Enumerates the BoringSSL source in src/ and either generates two gypi files
16 (boringssl.gypi and boringssl_tests.gypi) for Chromium, or generates
17 source-list files for Android."""
18
19import os
20import subprocess
21import sys
Adam Langley9c164b22015-06-10 18:54:47 -070022import json
Adam Langley9e1a6602015-05-05 17:47:53 -070023
24
25# OS_ARCH_COMBOS maps from OS and platform to the OpenSSL assembly "style" for
26# that platform and the extension used by asm files.
27OS_ARCH_COMBOS = [
28 ('linux', 'arm', 'linux32', [], 'S'),
29 ('linux', 'aarch64', 'linux64', [], 'S'),
30 ('linux', 'x86', 'elf', ['-fPIC', '-DOPENSSL_IA32_SSE2'], 'S'),
31 ('linux', 'x86_64', 'elf', [], 'S'),
32 ('mac', 'x86', 'macosx', ['-fPIC', '-DOPENSSL_IA32_SSE2'], 'S'),
33 ('mac', 'x86_64', 'macosx', [], 'S'),
34 ('win', 'x86', 'win32n', ['-DOPENSSL_IA32_SSE2'], 'asm'),
35 ('win', 'x86_64', 'nasm', [], 'asm'),
36]
37
38# NON_PERL_FILES enumerates assembly files that are not processed by the
39# perlasm system.
40NON_PERL_FILES = {
41 ('linux', 'arm'): [
Adam Langley9e1a6602015-05-05 17:47:53 -070042 'src/crypto/chacha/chacha_vec_arm.S',
43 'src/crypto/cpu-arm-asm.S',
Adam Langley7b8b9c12016-01-04 07:13:00 -080044 'src/crypto/curve25519/asm/x25519-asm-arm.S',
Adam Langleyb1b62292015-11-17 15:41:34 -080045 'src/crypto/poly1305/poly1305_arm_asm.S',
Adam Langley9e1a6602015-05-05 17:47:53 -070046 ],
Matt Braithwaitee021a242016-01-14 13:41:46 -080047 ('linux', 'x86_64'): [
48 'src/crypto/curve25519/asm/x25519-asm-x86_64.S',
49 ],
Adam Langley9e1a6602015-05-05 17:47:53 -070050}
51
52
53class Chromium(object):
54
55 def __init__(self):
56 self.header = \
57"""# Copyright (c) 2014 The Chromium Authors. All rights reserved.
58# Use of this source code is governed by a BSD-style license that can be
59# found in the LICENSE file.
60
61# This file is created by generate_build_files.py. Do not edit manually.
62
63"""
64
65 def PrintVariableSection(self, out, name, files):
66 out.write(' \'%s\': [\n' % name)
67 for f in sorted(files):
68 out.write(' \'%s\',\n' % f)
69 out.write(' ],\n')
70
71 def WriteFiles(self, files, asm_outputs):
72 with open('boringssl.gypi', 'w+') as gypi:
73 gypi.write(self.header + '{\n \'variables\': {\n')
74
75 self.PrintVariableSection(
Adam Langley049ef412015-06-09 18:20:57 -070076 gypi, 'boringssl_ssl_sources', files['ssl'])
77 self.PrintVariableSection(
78 gypi, 'boringssl_crypto_sources', files['crypto'])
Adam Langley9e1a6602015-05-05 17:47:53 -070079
80 for ((osname, arch), asm_files) in asm_outputs:
81 self.PrintVariableSection(gypi, 'boringssl_%s_%s_sources' %
82 (osname, arch), asm_files)
83
84 gypi.write(' }\n}\n')
85
86 with open('boringssl_tests.gypi', 'w+') as test_gypi:
87 test_gypi.write(self.header + '{\n \'targets\': [\n')
88
89 test_names = []
90 for test in sorted(files['test']):
91 test_name = 'boringssl_%s' % os.path.splitext(os.path.basename(test))[0]
92 test_gypi.write(""" {
93 'target_name': '%s',
94 'type': 'executable',
95 'dependencies': [
96 'boringssl.gyp:boringssl',
97 ],
98 'sources': [
99 '%s',
David Benjamin26073832015-05-11 20:52:48 -0400100 '<@(boringssl_test_support_sources)',
Adam Langley9e1a6602015-05-05 17:47:53 -0700101 ],
102 # TODO(davidben): Fix size_t truncations in BoringSSL.
103 # https://crbug.com/429039
104 'msvs_disabled_warnings': [ 4267, ],
105 },\n""" % (test_name, test))
106 test_names.append(test_name)
107
108 test_names.sort()
109
David Benjamin26073832015-05-11 20:52:48 -0400110 test_gypi.write(' ],\n \'variables\': {\n')
111
112 self.PrintVariableSection(
113 test_gypi, 'boringssl_test_support_sources', files['test_support'])
114
115 test_gypi.write(' \'boringssl_test_targets\': [\n')
Adam Langley9e1a6602015-05-05 17:47:53 -0700116
117 for test in test_names:
118 test_gypi.write(""" '%s',\n""" % test)
119
120 test_gypi.write(' ],\n }\n}\n')
121
122
123class Android(object):
124
125 def __init__(self):
126 self.header = \
127"""# Copyright (C) 2015 The Android Open Source Project
128#
129# Licensed under the Apache License, Version 2.0 (the "License");
130# you may not use this file except in compliance with the License.
131# You may obtain a copy of the License at
132#
133# http://www.apache.org/licenses/LICENSE-2.0
134#
135# Unless required by applicable law or agreed to in writing, software
136# distributed under the License is distributed on an "AS IS" BASIS,
137# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138# See the License for the specific language governing permissions and
139# limitations under the License.
140
141"""
142
Adam Langley049ef412015-06-09 18:20:57 -0700143 def ExtraFiles(self):
144 return ['android_compat_hacks.c', 'android_compat_keywrap.c']
145
Adam Langley9e1a6602015-05-05 17:47:53 -0700146 def PrintVariableSection(self, out, name, files):
147 out.write('%s := \\\n' % name)
148 for f in sorted(files):
149 out.write(' %s\\\n' % f)
150 out.write('\n')
151
152 def WriteFiles(self, files, asm_outputs):
153 with open('sources.mk', 'w+') as makefile:
154 makefile.write(self.header)
155
Piotr Sikora6ae67df2015-11-23 18:46:33 -0800156 crypto_files = files['crypto'] + self.ExtraFiles()
157 self.PrintVariableSection(makefile, 'crypto_sources', crypto_files)
Adam Langley9e1a6602015-05-05 17:47:53 -0700158 self.PrintVariableSection(makefile, 'ssl_sources', files['ssl'])
159 self.PrintVariableSection(makefile, 'tool_sources', files['tool'])
160
161 for ((osname, arch), asm_files) in asm_outputs:
162 self.PrintVariableSection(
163 makefile, '%s_%s_sources' % (osname, arch), asm_files)
164
165
Adam Langley049ef412015-06-09 18:20:57 -0700166class AndroidStandalone(Android):
167 """AndroidStandalone is for Android builds outside of the Android-system, i.e.
168
169 for applications that wish wish to ship BoringSSL.
170 """
171
172 def ExtraFiles(self):
173 return []
174
175
176class Bazel(object):
177 """Bazel outputs files suitable for including in Bazel files."""
178
179 def __init__(self):
180 self.firstSection = True
181 self.header = \
182"""# This file is created by generate_build_files.py. Do not edit manually.
183
184"""
185
186 def PrintVariableSection(self, out, name, files):
187 if not self.firstSection:
188 out.write('\n')
189 self.firstSection = False
190
191 out.write('%s = [\n' % name)
192 for f in sorted(files):
193 out.write(' "%s",\n' % f)
194 out.write(']\n')
195
196 def WriteFiles(self, files, asm_outputs):
Chuck Haysc608d6b2015-10-06 17:54:16 -0700197 with open('BUILD.generated.bzl', 'w+') as out:
Adam Langley049ef412015-06-09 18:20:57 -0700198 out.write(self.header)
199
200 self.PrintVariableSection(out, 'ssl_headers', files['ssl_headers'])
201 self.PrintVariableSection(
202 out, 'ssl_internal_headers', files['ssl_internal_headers'])
203 self.PrintVariableSection(out, 'ssl_sources', files['ssl'])
204 self.PrintVariableSection(out, 'crypto_headers', files['crypto_headers'])
205 self.PrintVariableSection(
206 out, 'crypto_internal_headers', files['crypto_internal_headers'])
207 self.PrintVariableSection(out, 'crypto_sources', files['crypto'])
208 self.PrintVariableSection(out, 'tool_sources', files['tool'])
209
210 for ((osname, arch), asm_files) in asm_outputs:
Adam Langley049ef412015-06-09 18:20:57 -0700211 self.PrintVariableSection(
Piotr Sikora3f5fe602015-10-28 12:24:35 -0700212 out, 'crypto_sources_%s_%s' % (osname, arch), asm_files)
Adam Langley049ef412015-06-09 18:20:57 -0700213
Chuck Haysc608d6b2015-10-06 17:54:16 -0700214 with open('BUILD.generated_tests.bzl', 'w+') as out:
Adam Langley9c164b22015-06-10 18:54:47 -0700215 out.write(self.header)
216
217 out.write('test_support_sources = [\n')
218 for filename in files['test_support']:
219 if os.path.basename(filename) == 'malloc.cc':
220 continue
221 out.write(' "%s",\n' % filename)
Adam Langley9c164b22015-06-10 18:54:47 -0700222
Chuck Haysc608d6b2015-10-06 17:54:16 -0700223 out.write(']\n\n')
224
225 out.write('def create_tests(copts):\n')
226 out.write(' test_support_sources_complete = test_support_sources + \\\n')
227 out.write(' native.glob(["src/crypto/test/*.h"])\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700228 name_counts = {}
229 for test in files['tests']:
230 name = os.path.basename(test[0])
231 name_counts[name] = name_counts.get(name, 0) + 1
232
233 first = True
234 for test in files['tests']:
235 name = os.path.basename(test[0])
236 if name_counts[name] > 1:
237 if '/' in test[1]:
238 name += '_' + os.path.splitext(os.path.basename(test[1]))[0]
239 else:
240 name += '_' + test[1].replace('-', '_')
241
242 if not first:
243 out.write('\n')
244 first = False
245
246 src_prefix = 'src/' + test[0]
247 for src in files['test']:
248 if src.startswith(src_prefix):
249 src = src
250 break
251 else:
252 raise ValueError("Can't find source for %s" % test[0])
253
Chuck Haysc608d6b2015-10-06 17:54:16 -0700254 out.write(' native.cc_test(\n')
255 out.write(' name = "%s",\n' % name)
256 out.write(' size = "small",\n')
257 out.write(' srcs = ["%s"] + test_support_sources_complete,\n' % src)
Adam Langley9c164b22015-06-10 18:54:47 -0700258
259 data_files = []
260 if len(test) > 1:
261
Chuck Haysc608d6b2015-10-06 17:54:16 -0700262 out.write(' args = [\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700263 for arg in test[1:]:
264 if '/' in arg:
Chuck Haysc608d6b2015-10-06 17:54:16 -0700265 out.write(' "$(location src/%s)",\n' % arg)
Adam Langley9c164b22015-06-10 18:54:47 -0700266 data_files.append('src/%s' % arg)
267 else:
Chuck Haysc608d6b2015-10-06 17:54:16 -0700268 out.write(' "%s",\n' % arg)
269 out.write(' ],\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700270
Chuck Haysc608d6b2015-10-06 17:54:16 -0700271 out.write(' copts = copts,\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700272
273 if len(data_files) > 0:
Chuck Haysc608d6b2015-10-06 17:54:16 -0700274 out.write(' data = [\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700275 for filename in data_files:
Chuck Haysc608d6b2015-10-06 17:54:16 -0700276 out.write(' "%s",\n' % filename)
277 out.write(' ],\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700278
279 if 'ssl/' in test[0]:
Chuck Haysc608d6b2015-10-06 17:54:16 -0700280 out.write(' deps = [\n')
281 out.write(' ":crypto",\n')
282 out.write(' ":ssl",\n')
283 out.write(' ],\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700284 else:
Chuck Haysc608d6b2015-10-06 17:54:16 -0700285 out.write(' deps = [":crypto"],\n')
286 out.write(' )\n')
Adam Langley9c164b22015-06-10 18:54:47 -0700287
Adam Langley049ef412015-06-09 18:20:57 -0700288
Adam Langley9e1a6602015-05-05 17:47:53 -0700289def FindCMakeFiles(directory):
290 """Returns list of all CMakeLists.txt files recursively in directory."""
291 cmakefiles = []
292
293 for (path, _, filenames) in os.walk(directory):
294 for filename in filenames:
295 if filename == 'CMakeLists.txt':
296 cmakefiles.append(os.path.join(path, filename))
297
298 return cmakefiles
299
300
301def NoTests(dent, is_dir):
302 """Filter function that can be passed to FindCFiles in order to remove test
303 sources."""
304 if is_dir:
305 return dent != 'test'
306 return 'test.' not in dent and not dent.startswith('example_')
307
308
309def OnlyTests(dent, is_dir):
310 """Filter function that can be passed to FindCFiles in order to remove
311 non-test sources."""
312 if is_dir:
David Benjamin26073832015-05-11 20:52:48 -0400313 return dent != 'test'
Adam Langley9e1a6602015-05-05 17:47:53 -0700314 return '_test.' in dent or dent.startswith('example_')
315
316
David Benjamin26073832015-05-11 20:52:48 -0400317def AllFiles(dent, is_dir):
318 """Filter function that can be passed to FindCFiles in order to include all
319 sources."""
320 return True
321
322
Adam Langley049ef412015-06-09 18:20:57 -0700323def SSLHeaderFiles(dent, is_dir):
324 return dent in ['ssl.h', 'tls1.h', 'ssl23.h', 'ssl3.h', 'dtls1.h']
325
326
Adam Langley9e1a6602015-05-05 17:47:53 -0700327def FindCFiles(directory, filter_func):
328 """Recurses through directory and returns a list of paths to all the C source
329 files that pass filter_func."""
330 cfiles = []
331
332 for (path, dirnames, filenames) in os.walk(directory):
333 for filename in filenames:
334 if not filename.endswith('.c') and not filename.endswith('.cc'):
335 continue
336 if not filter_func(filename, False):
337 continue
338 cfiles.append(os.path.join(path, filename))
339
340 for (i, dirname) in enumerate(dirnames):
341 if not filter_func(dirname, True):
342 del dirnames[i]
343
344 return cfiles
345
346
Adam Langley049ef412015-06-09 18:20:57 -0700347def FindHeaderFiles(directory, filter_func):
348 """Recurses through directory and returns a list of paths to all the header files that pass filter_func."""
349 hfiles = []
350
351 for (path, dirnames, filenames) in os.walk(directory):
352 for filename in filenames:
353 if not filename.endswith('.h'):
354 continue
355 if not filter_func(filename, False):
356 continue
357 hfiles.append(os.path.join(path, filename))
358
359 return hfiles
360
361
Adam Langley9e1a6602015-05-05 17:47:53 -0700362def ExtractPerlAsmFromCMakeFile(cmakefile):
363 """Parses the contents of the CMakeLists.txt file passed as an argument and
364 returns a list of all the perlasm() directives found in the file."""
365 perlasms = []
366 with open(cmakefile) as f:
367 for line in f:
368 line = line.strip()
369 if not line.startswith('perlasm('):
370 continue
371 if not line.endswith(')'):
372 raise ValueError('Bad perlasm line in %s' % cmakefile)
373 # Remove "perlasm(" from start and ")" from end
374 params = line[8:-1].split()
375 if len(params) < 2:
376 raise ValueError('Bad perlasm line in %s' % cmakefile)
377 perlasms.append({
378 'extra_args': params[2:],
379 'input': os.path.join(os.path.dirname(cmakefile), params[1]),
380 'output': os.path.join(os.path.dirname(cmakefile), params[0]),
381 })
382
383 return perlasms
384
385
386def ReadPerlAsmOperations():
387 """Returns a list of all perlasm() directives found in CMake config files in
388 src/."""
389 perlasms = []
390 cmakefiles = FindCMakeFiles('src')
391
392 for cmakefile in cmakefiles:
393 perlasms.extend(ExtractPerlAsmFromCMakeFile(cmakefile))
394
395 return perlasms
396
397
398def PerlAsm(output_filename, input_filename, perlasm_style, extra_args):
399 """Runs the a perlasm script and puts the output into output_filename."""
400 base_dir = os.path.dirname(output_filename)
401 if not os.path.isdir(base_dir):
402 os.makedirs(base_dir)
403 output = subprocess.check_output(
404 ['perl', input_filename, perlasm_style] + extra_args)
405 with open(output_filename, 'w+') as out_file:
406 out_file.write(output)
407
408
409def ArchForAsmFilename(filename):
410 """Returns the architectures that a given asm file should be compiled for
411 based on substrings in the filename."""
412
413 if 'x86_64' in filename or 'avx2' in filename:
414 return ['x86_64']
415 elif ('x86' in filename and 'x86_64' not in filename) or '586' in filename:
416 return ['x86']
417 elif 'armx' in filename:
418 return ['arm', 'aarch64']
419 elif 'armv8' in filename:
420 return ['aarch64']
421 elif 'arm' in filename:
422 return ['arm']
423 else:
424 raise ValueError('Unknown arch for asm filename: ' + filename)
425
426
427def WriteAsmFiles(perlasms):
428 """Generates asm files from perlasm directives for each supported OS x
429 platform combination."""
430 asmfiles = {}
431
432 for osarch in OS_ARCH_COMBOS:
433 (osname, arch, perlasm_style, extra_args, asm_ext) = osarch
434 key = (osname, arch)
435 outDir = '%s-%s' % key
436
437 for perlasm in perlasms:
438 filename = os.path.basename(perlasm['input'])
439 output = perlasm['output']
440 if not output.startswith('src'):
441 raise ValueError('output missing src: %s' % output)
442 output = os.path.join(outDir, output[4:])
William Hessec618c402015-06-22 16:34:02 +0200443 if output.endswith('-armx.${ASM_EXT}'):
444 output = output.replace('-armx',
445 '-armx64' if arch == 'aarch64' else '-armx32')
Adam Langley9e1a6602015-05-05 17:47:53 -0700446 output = output.replace('${ASM_EXT}', asm_ext)
447
448 if arch in ArchForAsmFilename(filename):
449 PerlAsm(output, perlasm['input'], perlasm_style,
450 perlasm['extra_args'] + extra_args)
451 asmfiles.setdefault(key, []).append(output)
452
453 for (key, non_perl_asm_files) in NON_PERL_FILES.iteritems():
454 asmfiles.setdefault(key, []).extend(non_perl_asm_files)
455
456 return asmfiles
457
458
Adam Langley049ef412015-06-09 18:20:57 -0700459def main(platforms):
Adam Langley9e1a6602015-05-05 17:47:53 -0700460 crypto_c_files = FindCFiles(os.path.join('src', 'crypto'), NoTests)
461 ssl_c_files = FindCFiles(os.path.join('src', 'ssl'), NoTests)
462 tool_cc_files = FindCFiles(os.path.join('src', 'tool'), NoTests)
463
464 # Generate err_data.c
465 with open('err_data.c', 'w+') as err_data:
466 subprocess.check_call(['go', 'run', 'err_data_generate.go'],
467 cwd=os.path.join('src', 'crypto', 'err'),
468 stdout=err_data)
469 crypto_c_files.append('err_data.c')
470
David Benjamin26073832015-05-11 20:52:48 -0400471 test_support_cc_files = FindCFiles(os.path.join('src', 'crypto', 'test'),
472 AllFiles)
473
Adam Langley9e1a6602015-05-05 17:47:53 -0700474 test_c_files = FindCFiles(os.path.join('src', 'crypto'), OnlyTests)
475 test_c_files += FindCFiles(os.path.join('src', 'ssl'), OnlyTests)
476
Adam Langley049ef412015-06-09 18:20:57 -0700477 ssl_h_files = (
478 FindHeaderFiles(
479 os.path.join('src', 'include', 'openssl'),
480 SSLHeaderFiles))
481
482 def NotSSLHeaderFiles(filename, is_dir):
483 return not SSLHeaderFiles(filename, is_dir)
484 crypto_h_files = (
485 FindHeaderFiles(
486 os.path.join('src', 'include', 'openssl'),
487 NotSSLHeaderFiles))
488
489 ssl_internal_h_files = FindHeaderFiles(os.path.join('src', 'ssl'), NoTests)
490 crypto_internal_h_files = FindHeaderFiles(
491 os.path.join('src', 'crypto'), NoTests)
492
Adam Langley9c164b22015-06-10 18:54:47 -0700493 with open('src/util/all_tests.json', 'r') as f:
494 tests = json.load(f)
495 test_binaries = set([test[0] for test in tests])
496 test_sources = set([
497 test.replace('.cc', '').replace('.c', '').replace(
498 'src/',
499 '')
500 for test in test_c_files])
501 if test_binaries != test_sources:
502 print 'Test sources and configured tests do not match'
503 a = test_binaries.difference(test_sources)
504 if len(a) > 0:
505 print 'These tests are configured without sources: ' + str(a)
506 b = test_sources.difference(test_binaries)
507 if len(b) > 0:
508 print 'These test sources are not configured: ' + str(b)
509
Adam Langley9e1a6602015-05-05 17:47:53 -0700510 files = {
511 'crypto': crypto_c_files,
Adam Langley049ef412015-06-09 18:20:57 -0700512 'crypto_headers': crypto_h_files,
513 'crypto_internal_headers': crypto_internal_h_files,
Adam Langley9e1a6602015-05-05 17:47:53 -0700514 'ssl': ssl_c_files,
Adam Langley049ef412015-06-09 18:20:57 -0700515 'ssl_headers': ssl_h_files,
516 'ssl_internal_headers': ssl_internal_h_files,
Adam Langley9e1a6602015-05-05 17:47:53 -0700517 'tool': tool_cc_files,
518 'test': test_c_files,
David Benjamin26073832015-05-11 20:52:48 -0400519 'test_support': test_support_cc_files,
Adam Langley9c164b22015-06-10 18:54:47 -0700520 'tests': tests,
Adam Langley9e1a6602015-05-05 17:47:53 -0700521 }
522
523 asm_outputs = sorted(WriteAsmFiles(ReadPerlAsmOperations()).iteritems())
524
Adam Langley049ef412015-06-09 18:20:57 -0700525 for platform in platforms:
526 platform.WriteFiles(files, asm_outputs)
Adam Langley9e1a6602015-05-05 17:47:53 -0700527
528 return 0
529
530
531def Usage():
Adam Langley049ef412015-06-09 18:20:57 -0700532 print 'Usage: python %s [chromium|android|android-standalone|bazel]' % sys.argv[0]
Adam Langley9e1a6602015-05-05 17:47:53 -0700533 sys.exit(1)
534
535
536if __name__ == '__main__':
Adam Langley049ef412015-06-09 18:20:57 -0700537 if len(sys.argv) < 2:
Adam Langley9e1a6602015-05-05 17:47:53 -0700538 Usage()
539
Adam Langley049ef412015-06-09 18:20:57 -0700540 platforms = []
541 for s in sys.argv[1:]:
542 if s == 'chromium' or s == 'gyp':
543 platforms.append(Chromium())
544 elif s == 'android':
545 platforms.append(Android())
546 elif s == 'android-standalone':
547 platforms.append(AndroidStandalone())
548 elif s == 'bazel':
549 platforms.append(Bazel())
550 else:
551 Usage()
Adam Langley9e1a6602015-05-05 17:47:53 -0700552
Adam Langley049ef412015-06-09 18:20:57 -0700553 sys.exit(main(platforms))