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