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