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