Create build_linux_secure_with_tcp and cleanup build_android job
[platform/upstream/iotivity.git] / auto_build.py
1 #!/usr/bin/python
2
3 import os
4 import sys
5 import platform
6 import subprocess
7 import multiprocessing
8
9 # help message
10 def helpmsg(script):
11     helpstr = '''
12 Usage:
13     build:
14         python %s <targetbuild>
15         Allowed values for <target_build>: all, linux_unsecured, linux_secured, linux_unsecured_with_ra, linux_secured_with_ra, linux_unsecured_with_rd, linux_secured_with_rd, android, arduino, tizen, simulator, darwin, windows, msys
16         Note: \"linux\" will build \"linux_unsecured\", \"linux_secured\", \"linux_unsecured_with_ra\", \"linux_secured_with_ra\", \"linux_secured_with_rd\", \"linux_unsecured_with_mq\", \"linux_secured_with_tcp\" & \"linux_unsecured_with_tcp\" & \"linux_unsecured_with_rd\".
17         Any selection will build both debug and release versions of all available targets in the scope you've selected.
18         To choose any specific command, please use the SCons commandline directly. Please refer to [IOTIVITY_REPO]/Readme.scons.txt.
19     clean:
20         python %s -c
21     '''
22     print (helpstr % (script, script))
23     sys.exit()
24
25 def call_scons(build_options, extra_option_str):
26     """
27     This function formats and runs a scons command
28     Arguments:
29     build_options    -- {Dictionary} build flags (keys) associated with values;
30     extra_option_str -- {String} extra options to append to scons command
31     """
32     cmd_line = "scons VERBOSE=" + VERBOSE
33     for key in build_options:
34         cmd_line += " " + key + "=" + str(build_options[key])
35
36     cmd_line += " " + str(extra_option_str)
37
38     print ("Running : " + cmd_line)
39     sys.stdout.flush()
40     exit_code = subprocess.Popen([cmd_line], shell=True).wait()
41     if exit_code != 0:
42         exit(exit_code)
43
44 def build_all(flag, extra_option_str):
45     if platform.system() == "Linux":
46         build_linux_unsecured(flag, extra_option_str)
47         build_linux_secured(flag, extra_option_str)
48         build_linux_unsecured_with_ra(flag, extra_option_str)
49         build_linux_secured_with_ra(flag, extra_option_str)
50         build_linux_unsecured_with_rm(flag, extra_option_str)
51         build_linux_unsecured_with_rd(flag, extra_option_str)
52         build_linux_secured_with_rd(flag, extra_option_str)
53         build_linux_unsecured_with_mq(flag, extra_option_str)
54         build_linux_unsecured_with_tcp(flag, extra_option_str)
55         build_linux_secured_with_tcp(flag, extra_option_str)
56         build_simulator(flag, extra_option_str)
57
58     build_android(flag, extra_option_str)
59     build_arduino(flag, extra_option_str)
60     build_tizen(flag, extra_option_str)
61
62     if platform.system() == "Windows":
63         build_windows(flag, extra_option_str)
64
65     if platform.system() == "Darwin":
66         build_darwin(flag, extra_option_str)
67
68 def build_linux(flag, extra_option_str):
69     build_linux_unsecured(flag, extra_option_str)
70     build_linux_secured(flag, extra_option_str)
71
72 def build_linux_unsecured(flag, extra_option_str):
73     print ("*********** Build for linux ************")
74     build_options = {
75                         'RELEASE':flag,
76                     }
77     call_scons(build_options, extra_option_str)
78
79 def build_linux_secured_with_tcp(flag, extra_option_str):
80     print ("*********** Build for linux with Secured TCP ************")
81     build_options = {
82                         'RELEASE':flag,
83                         'WITH_TCP': 1,
84                         'WITH_CLOUD':1,
85                         'SECURED':1,
86                     }
87     call_scons(build_options, extra_option_str)
88
89 def build_linux_unsecured_with_tcp(flag, extra_option_str):
90     print ("*********** Build for linux with TCP ************")
91     build_options = {
92                         'RELEASE':flag,
93                         'WITH_TCP': 1,
94                         'TARGET_TRANSPORT': 'IP',
95                     }
96     call_scons(build_options, extra_option_str)
97
98 def build_linux_unsecured_with_rm(flag, extra_option_str):
99     print ("*********** Build for linux with RoutingManager************")
100     build_options = {
101                         'ROUTING':'GW',
102                         'RELEASE':flag,
103                     }
104     call_scons(build_options, extra_option_str)
105
106 def build_linux_secured(flag, extra_option_str):
107     print ("*********** Build for linux with Security *************")
108     build_options = {
109                         'RELEASE':flag,
110                         'SECURED':1,
111                     }
112     call_scons(build_options, extra_option_str)
113
114 def build_linux_unsecured_with_ra(flag, extra_option_str):
115     print ("*********** Build for linux With Remote Access *************")
116     build_options = {
117                         'RELEASE':flag,
118                         'WITH_RA':1,
119                         'WITH_RA_IBB':1,
120                     }
121     call_scons(build_options, extra_option_str)
122
123 def build_linux_secured_with_ra(flag, extra_option_str):
124     print ("*********** Build for linux With Remote Access & Security ************")
125     build_options = {
126                         'RELEASE':flag,
127                         'WITH_RA':1,
128                         'WITH_RA_IBB':1,
129                         'SECURED':1,
130                     }
131     call_scons(build_options, extra_option_str)
132
133 def build_linux_unsecured_with_rd(flag, extra_option_str):
134     print ("*********** Build for linux With Resource Directory *************")
135     build_options = {
136                         'RELEASE':flag,
137                         'WITH_RD':1,
138                     }
139     call_scons(build_options, extra_option_str)
140
141 def build_linux_secured_with_rd(flag, extra_option_str):
142     print ("*********** Build for linux With Resource Directory & Security ************")
143     build_options = {
144                         'RELEASE':flag,
145                         'WITH_RD':1,
146                         'SECURED':1,
147                     }
148     call_scons(build_options, extra_option_str)
149
150 def build_linux_unsecured_with_mq(flag, extra_option_str):
151     print ("*********** Build for linux With Message Queue ************")
152     build_options = {
153                         'RELEASE':flag,
154                         'WITH_MQ':'PUB,SUB,BROKER',
155                     }
156     call_scons(build_options, extra_option_str)
157
158 def build_linux_unsecured_with_tcp(flag, extra_option_str):
159     print ("*********** Build for linux With tcp ************")
160     build_options = {
161                         'RELEASE':flag,
162                         'WITH_TCP':'1',
163                     }
164     call_scons(build_options, extra_option_str)
165
166 def build_android(flag, extra_option_str):
167     # Note: for android, as oic-resource uses C++11 feature stoi and to_string,
168     # it requires gcc-4.9, currently only android-ndk-r10(for linux)
169     # and windows android-ndk-r10(64bit target version) support these features.
170     print ("*********** Build for android armeabi *************")
171     build_options = {
172                         'TARGET_OS':'android',
173                         'TARGET_ARCH':'armeabi',
174                         'RELEASE':flag,
175                     }
176     call_scons(build_options, extra_option_str)
177
178 def build_android_x86(flag, extra_option_str):
179     """ Build Android x86 Suite """
180     build_android_x86_with_ip(flag, extra_option_str)
181     build_android_x86_with_bt(flag, extra_option_str)
182     build_android_x86_with_ble(flag, extra_option_str)
183
184 def build_android_x86_with_ip(flag, extra_option_str):
185     print ("*********** Build for android x86 *************")
186     build_options = {
187                         'TARGET_OS':'android',
188                         'TARGET_ARCH':'x86',
189                         'RELEASE':flag,
190                         'TARGET_TRANSPORT':'IP',
191                     }
192     call_scons(build_options, extra_option_str)
193
194 def build_android_x86_with_bt(flag, extra_option_str):
195     print ("*********** Build for android x86 with Bluetooth *************")
196     build_options = {
197                         'TARGET_OS':'android',
198                         'TARGET_ARCH':'x86',
199                         'RELEASE':flag,
200                         'TARGET_TRANSPORT':'BT',
201                     }
202     call_scons(build_options, extra_option_str)
203
204 def build_android_x86_with_ble(flag, extra_option_str):
205     print ("*********** Build for android x86 with Bluetooth Low Energy *************")
206     build_options = {
207                         'TARGET_OS':'android',
208                         'TARGET_ARCH':'x86',
209                         'RELEASE':flag,
210                         'TARGET_TRANSPORT':'BLE',
211                     }
212     call_scons(build_options, extra_option_str)
213
214 def build_android_x86_with_rm(flag, extra_option_str):
215     """ Build Android x86 Routing Manager Suite """
216     build_android_x86_with_rm_and_ip(flag, extra_option_str)
217     build_android_x86_with_rm_and_bt(flag, extra_option_str)
218     build_android_x86_with_rm_and_ble(flag, extra_option_str)
219
220 def build_android_x86_with_rm_and_ip(flag, extra_option_str):
221     print ("*********** Build for android x86 with Routing Manager *************")
222     build_options = {
223                         'TARGET_OS':'android',
224                         'TARGET_ARCH':'x86',
225                         'ROUTING':'GW',
226                         'RELEASE':flag,
227                         'TARGET_TRANSPORT':'IP',
228                     }
229     call_scons(build_options, extra_option_str)
230
231 def build_android_x86_with_rm_and_bt(flag, extra_option_str):
232     print ("*********** Build for android x86 with Routing Manager and Bluetooth *************")
233     build_options = {
234                         'TARGET_OS':'android',
235                         'TARGET_ARCH':'x86',
236                         'ROUTING':'GW',
237                         'RELEASE':flag,
238                         'TARGET_TRANSPORT':'BT',
239                     }
240     call_scons(build_options, extra_option_str)
241
242 def build_android_x86_with_rm_and_ble(flag, extra_option_str):
243     print ("*********** Build for android x86 with Routing Manager and Bluetooth Low Energy *************")
244     build_options = {
245                         'TARGET_OS':'android',
246                         'TARGET_ARCH':'x86',
247                         'ROUTING':'GW',
248                         'RELEASE':flag,
249                         'TARGET_TRANSPORT':'BLE',
250                     }
251     call_scons(build_options, extra_option_str)
252
253 def build_android_armeabi(flag, extra_option_str):
254     """ Build Android Armeabi Suite """
255     build_android_armeabi_with_ip(flag, extra_option_str)
256     build_android_armeabi_with_bt(flag, extra_option_str)
257     build_android_armeabi_with_ble(flag, extra_option_str)
258
259 def build_android_armeabi_with_ip(flag, extra_option_str):
260     print ("*********** Build for android armeabi *************")
261     build_options = {
262                         'TARGET_OS':'android',
263                         'TARGET_ARCH':'armeabi',
264                         'RELEASE':flag,
265                         'TARGET_TRANSPORT':'IP',
266                     }
267     call_scons(build_options, extra_option_str)
268
269 def build_android_armeabi_with_bt(flag, extra_option_str):
270     print ("*********** Build for android armeabi with Bluetooth *************")
271     build_options = {
272                         'TARGET_OS':'android',
273                         'TARGET_ARCH':'armeabi',
274                         'RELEASE':flag,
275                         'TARGET_TRANSPORT':'BT',
276                     }
277     call_scons(build_options, extra_option_str)
278
279 def build_android_armeabi_with_ble(flag, extra_option_str):
280     print ("*********** Build for android armeabi with Bluetooth Low Energy *************")
281     build_options = {
282                         'TARGET_OS':'android',
283                         'TARGET_ARCH':'armeabi',
284                         'RELEASE':flag,
285                         'TARGET_TRANSPORT':'BLE',
286                     }
287     call_scons(build_options, extra_option_str)
288
289 def build_android_armeabi_with_rm(flag, extra_option_str):
290     """ Build Android Armeabi Routing Manager Suite """
291     build_android_armeabi_with_rm_and_ip(flag, extra_option_str)
292     build_android_armeabi_with_rm_and_bt(flag, extra_option_str)
293     build_android_armeabi_with_rm_and_ble(flag, extra_option_str)
294
295 def build_android_armeabi_with_rm_and_ip(flag, extra_option_str):
296     print ("*********** Build for android armeabi with Routing Manager *************")
297     build_options = {
298                         'TARGET_OS':'android',
299                         'TARGET_ARCH':'armeabi',
300                         'ROUTING':'GW',
301                         'RELEASE':flag,
302                         'TARGET_TRANSPORT':'IP',
303                     }
304     call_scons(build_options, extra_option_str)
305
306 def build_android_armeabi_with_rm_and_bt(flag, extra_option_str):
307     print ("*********** Build for android armeabi with Routing Manager and Bluetooth *************")
308     build_options = {
309                         'TARGET_OS':'android',
310                         'TARGET_ARCH':'armeabi',
311                         'ROUTING':'GW',
312                         'RELEASE':flag,
313                         'TARGET_TRANSPORT':'BT',
314                     }
315     call_scons(build_options, extra_option_str)
316
317 def build_android_armeabi_with_rm_and_ble(flag, extra_option_str):
318     print ("*********** Build for android armeabi with Routing Manager and Bluetooth Low Energy *************")
319     build_options = {
320                         'TARGET_OS':'android',
321                         'TARGET_ARCH':'armeabi',
322                         'ROUTING':'GW',
323                         'RELEASE':flag,
324                         'TARGET_TRANSPORT':'BLE',
325                     }
326     call_scons(build_options, extra_option_str)
327
328 def build_arduino(flag, extra_option_str):
329     print ("*********** Build for arduino avr *************")
330     extra_option_str = "resource " + extra_option_str
331     build_options = {
332                         'TARGET_OS':'arduino',
333                         'UPLOAD':'false',
334                         'BOARD':'mega',
335                         'TARGET_ARCH':'avr',
336                         'TARGET_TRANSPORT':'IP',
337                         'SHIELD':'ETH',
338                         'RELEASE':flag,
339                     }
340     call_scons(build_options, extra_option_str)
341
342     build_options['SHIELD'] = 'WIFI'
343     call_scons(build_options, extra_option_str)
344
345     build_options['TARGET_TRANSPORT'] = 'BLE'
346     build_options['SHIELD']           = 'RBL_NRF8001'
347     call_scons(build_options, extra_option_str)
348
349     print ("*********** Build for arduino arm *************")
350     build_options['BOARD']            = 'arduino_due_x'
351     build_options['TARGET_ARCH']      = 'arm'
352     build_options['TARGET_TRANSPORT'] = 'IP'
353     build_options['SHIELD']           = 'ETH'
354     call_scons(build_options, extra_option_str)
355
356     build_options['SHIELD'] = 'WIFI'
357     call_scons(build_options, extra_option_str)
358
359     # BLE support for the Arduino Due is currently unavailable.
360
361 def build_tizen(flag, extra_option_str):
362     print ("*********** Build for Tizen *************")
363     cmd_line = "/bin/sh " + os.getcwd() + "/gbsbuild.sh"
364     print ("Running : " + cmd_line)
365     subprocess.Popen([cmd_line], shell=True).wait()
366
367     print ("*********** Build for Tizen octbstack lib and sample *************")
368     extra_option_str = "-f resource/csdk/stack/samples/tizen/build/SConscript " + extra_option_str
369     build_options = {
370                         'TARGET_OS':'tizen',
371                         'TARGET_TRANSPORT':'IP',
372                         'LOGGING':'true',
373                         'RELEASE':flag,
374                     }
375     call_scons(build_options, extra_option_str)
376
377     print ("*********** Build for Tizen octbstack lib and sample with Security*************")
378     build_options['SECURED'] = 1
379     call_scons(build_options, extra_option_str)
380
381     print ("*********** Build for Tizen octbstack lib and sample with Routing Manager*************")
382     del build_options['SECURED']
383     build_options['ROUTING'] = 'GW'
384     call_scons(build_options, extra_option_str)
385
386 # Mac OS and iOS
387 def build_darwin(flag, extra_option_str):
388     print ("*********** Build for OSX *************")
389     build_options = {
390                         'TARGET_OS':'darwin',
391                         'SYS_VERSION':'10.9',
392                         'RELEASE':flag,
393                     }
394     call_scons(build_options, extra_option_str)
395
396     print ("*********** Build for IOS i386 *************")
397     build_options = {
398                         'TARGET_OS':'ios',
399                         'TARGET_ARCH':'i386',
400                         'SYS_VERSION':'7.0',
401                         'RELEASE':flag,
402                     }
403     call_scons(build_options, extra_option_str)
404
405     print ("*********** Build for IOS x86_64 *************")
406     build_options['TARGET_ARCH'] = 'x86_64'
407     call_scons(build_options, extra_option_str)
408
409     print ("*********** Build for IOS armv7 *************")
410     build_options['TARGET_ARCH'] = 'armv7'
411     call_scons(build_options, extra_option_str)
412
413     print ("*********** Build for IOS armv7s *************")
414     build_options['TARGET_ARCH'] = 'armv7s'
415     call_scons(build_options, extra_option_str)
416
417     print ("*********** Build for IOS arm64 *************")
418     build_options['TARGET_ARCH'] = 'arm64'
419     call_scons(build_options, extra_option_str)
420
421 # Windows
422 def build_windows(flag, extra_option_str):
423     print ("*********** Build for Windows *************")
424     os.environ["SCONSFLAGS"] = ""
425     build_options = {
426                         'TARGET_OS':'windows',
427                         'TARGET_ARCH':'amd64',
428                         'RELEASE':flag,
429                         'WITH_RA':0,
430                         'TARGET_TRANSPORT':'IP',
431                         'SECURED':1,
432                         'WITH_TCP':0,
433                         'BUILD_SAMPLE':'ON',
434                         'LOGGING':'off',
435                         'TEST':1,
436                         'WITH_RD':1,
437                     }
438     call_scons(build_options, extra_option_str)
439
440 # Windows msys
441 def build_msys(flag, extra_option_str):
442     print ("*********** Build for msys_nt *************")
443     os.environ["SCONSFLAGS"] = ""
444     build_options = {
445                         'TARGET_OS':'msys_nt',
446                         'TARGET_ARCH':'x86_64',
447                         'RELEASE':flag,
448                         'WITH_RA':0,
449                         'TARGET_TRANSPORT':'IP',
450                         'SECURED':1,
451                         'WITH_TCP':0,
452                         'BUILD_SAMPLE':'ON',
453                         'LOGGING':'off',
454                         'TEST':1,
455                         'WITH_RD':1,
456                     }
457     call_scons(build_options, extra_option_str)
458
459 def build_simulator(flag, extra_option_str):
460     print ("*********** Build for simulator plugin *************")
461     build_options = {
462                         'SIMULATOR':1,
463                         'RELEASE':flag,
464                     }
465     call_scons(build_options, extra_option_str)
466
467 def unit_tests():
468     print ("*********** Unit test Start *************")
469     build_options = {
470                         'RELEASE':'false',
471                     }
472     extra_option_str = "resource -c"
473     call_scons(build_options, extra_option_str)
474
475     build_options = {
476                         'LOGGING':'false',
477                         'RELEASE':'false',
478                     }
479     extra_option_str = "resource"
480     call_scons(build_options, extra_option_str)
481
482     build_options = {
483                         'TEST':1,
484                         'RELEASE':'false',
485                     }
486     extra_option_str = "resource"
487     call_scons(build_options, extra_option_str)
488
489     print ("*********** Unit test Stop *************")
490
491 # Main module starts here
492 if os.getenv("SCONSFLAGS", "") == "":
493     os.environ["SCONSFLAGS"] = "-Q -j " + str(multiprocessing.cpu_count())
494
495 arg_num     = len(sys.argv)
496 script_name = sys.argv[0]
497
498 # May be overridden in user's shell
499 VERBOSE = os.getenv("VERBOSE", "1")
500
501 if arg_num == 1:
502     build_all("true", "")
503     build_all("false", "")
504     unit_tests()
505
506 elif arg_num == 2:
507     if str(sys.argv[1]) == '-c':
508         build_all("true", "-c")
509         build_all("false", "-c")
510
511     elif str(sys.argv[1]) == "all":
512         build_all("true", "")
513         build_all("false", "")
514         unit_tests()
515
516     elif str(sys.argv[1]) == "linux":
517         build_linux("true", "")
518         build_linux("false", "")
519
520     elif str(sys.argv[1]) == "linux_unsecured":
521         build_linux_unsecured("true", "")
522         build_linux_unsecured("false", "")
523         build_linux_unsecured_with_rm("true", "")
524         build_linux_unsecured_with_rm("false", "")
525
526     elif str(sys.argv[1]) == "linux_secured":
527         build_linux_secured("true", "")
528         build_linux_secured("false", "")
529
530     elif str(sys.argv[1]) == "linux_unsecured_with_ra":
531         build_linux_unsecured_with_ra("true", "")
532         build_linux_unsecured_with_ra("false", "")
533
534     elif str(sys.argv[1]) == "linux_secured_with_ra":
535         build_linux_secured_with_ra("true", "")
536         build_linux_secured_with_ra("false", "")
537
538     elif str(sys.argv[1]) == "linux_unsecured_with_rd":
539         build_linux_unsecured_with_rd("true", "")
540         build_linux_unsecured_with_rd("false", "")
541
542     elif str(sys.argv[1]) == "linux_secured_with_rd":
543         build_linux_secured_with_rd("true", "")
544         build_linux_secured_with_rd("false", "")
545
546     elif str(sys.argv[1]) == "linux_unsecured_with_mq":
547         build_linux_unsecured_with_mq("true", "")
548         build_linux_unsecured_with_mq("false", "")
549
550     elif str(sys.argv[1]) == "linux_unsecured_with_tcp":
551         build_linux_unsecured_with_tcp("true", "")
552         build_linux_unsecured_with_tcp("false", "")
553
554     elif str(sys.argv[1]) == "linux_secured_with_tcp":
555         build_linux_secured_with_tcp("false", "")
556         build_linux_secured_with_tcp("true", "")
557
558     elif str(sys.argv[1]) == "android":
559         build_android("true", "")
560         build_android("false", "")
561
562     elif str(sys.argv[1]) == "android_x86":
563         build_android_x86("true", "")
564         build_android_x86("false", "")
565         build_android_x86_with_rm("true", "")
566         build_android_x86_with_rm("false", "")
567
568     elif str(sys.argv[1]) == "android_x86_with_ip":
569         build_android_x86_with_ip("true", "")
570         build_android_x86_with_ip("false", "")
571
572     elif str(sys.argv[1]) == "android_x86_with_bt":
573         build_android_x86_with_bt("true", "")
574         build_android_x86_with_bt("false", "")
575
576     elif str(sys.argv[1]) == "android_x86_with_ble":
577         build_android_x86_with_ble("true", "")
578         build_android_x86_with_ble("false", "")
579
580     elif str(sys.argv[1]) == "android_x86_with_rm_and_ip":
581         build_android_x86_with_rm_and_ip("true", "")
582         build_android_x86_with_rm_and_ip("false", "")
583
584     elif str(sys.argv[1]) == "android_x86_with_rm_and_bt":
585         build_android_x86_with_rm_and_bt("true", "")
586         build_android_x86_with_rm_and_bt("false", "")
587
588     elif str(sys.argv[1]) == "android_x86_with_rm_and_ble":
589         build_android_x86_with_rm_and_ble("true", "")
590         build_android_x86_with_rm_and_ble("false", "")
591
592     elif str(sys.argv[1]) == "android_armeabi":
593         build_android_armeabi("true", "")
594         build_android_armeabi("false", "")
595         build_android_armeabi_with_rm("true", "")
596         build_android_armeabi_with_rm("false", "")
597
598     elif str(sys.argv[1]) == "android_armeabi_with_ip":
599         build_android_armeabi_with_ip("true", "")
600         build_android_armeabi_with_ip("false", "")
601
602     elif str(sys.argv[1]) == "android_armeabi_with_bt":
603         build_android_armeabi_with_bt("true", "")
604         build_android_armeabi_with_bt("false", "")
605
606     elif str(sys.argv[1]) == "android_armeabi_with_ble":
607         build_android_armeabi_with_ble("true", "")
608         build_android_armeabi_with_ble("false", "")
609
610     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_ip":
611         build_android_armeabi_with_rm_and_ip("true", "")
612         build_android_armeabi_with_rm_and_ip("false", "")
613
614     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_bt":
615         build_android_armeabi_with_rm_and_bt("true", "")
616         build_android_armeabi_with_rm_and_bt("false", "")
617
618     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_ble":
619         build_android_armeabi_with_rm_and_ble("true", "")
620         build_android_armeabi_with_rm_and_ble("false", "")
621
622     elif str(sys.argv[1]) == "arduino":
623         build_arduino("true", "")
624         build_arduino("false", "")
625
626     elif str(sys.argv[1]) == "windows":
627         build_windows("true", "")
628         build_windows("false", "")
629
630     elif str(sys.argv[1]) == "msys":
631         build_msys("true", "")
632         build_msys("false", "")
633
634     elif str(sys.argv[1]) == "tizen":
635         build_tizen("true", "")
636         build_tizen("false", "")
637
638     elif str(sys.argv[1]) == "simulator":
639         build_simulator("true", "")
640         build_simulator("false", "")
641
642     elif str(sys.argv[1]) == "darwin":
643         build_darwin("true", "")
644         build_darwin("false", "")
645
646     elif str(sys.argv[1]) == "unit_tests":
647         unit_tests()
648
649     else:
650         helpmsg(script_name)
651 else:
652         helpmsg(script_name)
653
654 print ("===================== done =====================")