[IOT-1089] Merge remote-tracking branch 'origin/master' into generic-java
[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': 'ON',
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': 'ON',
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     extra_option_str = "resource"
508     call_scons(build_options, extra_option_str)
509
510     print ("*********** Unit test Stop *************")
511
512 # Main module starts here
513 if os.getenv("SCONSFLAGS", "") == "":
514     os.environ["SCONSFLAGS"] = "-Q -j " + str(multiprocessing.cpu_count())
515
516 arg_num     = len(sys.argv)
517 script_name = sys.argv[0]
518
519 # May be overridden in user's shell
520 VERBOSE = os.getenv("VERBOSE", "1")
521
522 if arg_num == 1:
523     build_all("true", "")
524     build_all("false", "")
525     unit_tests()
526
527 elif arg_num == 2:
528     if str(sys.argv[1]) == '-c':
529         build_all("true", "-c")
530         build_all("false", "-c")
531
532     elif str(sys.argv[1]) == "all":
533         build_all("true", "")
534         build_all("false", "")
535         unit_tests()
536
537     elif str(sys.argv[1]) == "linux":
538         build_linux("true", "")
539         build_linux("false", "")
540
541     elif str(sys.argv[1]) == "linux_unsecured":
542         build_linux_unsecured("true", "")
543         build_linux_unsecured("false", "")
544         build_linux_unsecured_with_rm("true", "")
545         build_linux_unsecured_with_rm("false", "")
546
547     elif str(sys.argv[1]) == "linux_secured":
548         build_linux_secured("true", "")
549         build_linux_secured("false", "")
550
551     elif str(sys.argv[1]) == "linux_unsecured_with_ra":
552         build_linux_unsecured_with_ra("true", "")
553         build_linux_unsecured_with_ra("false", "")
554
555     elif str(sys.argv[1]) == "linux_secured_with_ra":
556         build_linux_secured_with_ra("true", "")
557         build_linux_secured_with_ra("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_x86":
592         build_android_x86("true", "")
593         build_android_x86("false", "")
594         build_android_x86_with_rm("true", "")
595         build_android_x86_with_rm("false", "")
596
597     elif str(sys.argv[1]) == "android_x86_with_ip":
598         build_android_x86_with_ip("true", "")
599         build_android_x86_with_ip("false", "")
600
601     elif str(sys.argv[1]) == "android_x86_with_bt":
602         build_android_x86_with_bt("true", "")
603         build_android_x86_with_bt("false", "")
604
605     elif str(sys.argv[1]) == "android_x86_with_ble":
606         build_android_x86_with_ble("true", "")
607         build_android_x86_with_ble("false", "")
608
609     elif str(sys.argv[1]) == "android_x86_with_rm_and_ip":
610         build_android_x86_with_rm_and_ip("true", "")
611         build_android_x86_with_rm_and_ip("false", "")
612
613     elif str(sys.argv[1]) == "android_x86_with_rm_and_bt":
614         build_android_x86_with_rm_and_bt("true", "")
615         build_android_x86_with_rm_and_bt("false", "")
616
617     elif str(sys.argv[1]) == "android_x86_with_rm_and_ble":
618         build_android_x86_with_rm_and_ble("true", "")
619         build_android_x86_with_rm_and_ble("false", "")
620
621     elif str(sys.argv[1]) == "android_armeabi":
622         build_android_armeabi("true", "")
623         build_android_armeabi("false", "")
624         build_android_armeabi_with_rm("true", "")
625         build_android_armeabi_with_rm("false", "")
626
627     elif str(sys.argv[1]) == "android_armeabi_with_ip":
628         build_android_armeabi_with_ip("true", "")
629         build_android_armeabi_with_ip("false", "")
630
631     elif str(sys.argv[1]) == "android_armeabi_with_bt":
632         build_android_armeabi_with_bt("true", "")
633         build_android_armeabi_with_bt("false", "")
634
635     elif str(sys.argv[1]) == "android_armeabi_with_ble":
636         build_android_armeabi_with_ble("true", "")
637         build_android_armeabi_with_ble("false", "")
638
639     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_ip":
640         build_android_armeabi_with_rm_and_ip("true", "")
641         build_android_armeabi_with_rm_and_ip("false", "")
642
643     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_bt":
644         build_android_armeabi_with_rm_and_bt("true", "")
645         build_android_armeabi_with_rm_and_bt("false", "")
646
647     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_ble":
648         build_android_armeabi_with_rm_and_ble("true", "")
649         build_android_armeabi_with_rm_and_ble("false", "")
650
651     elif str(sys.argv[1]) == "arduino":
652         build_arduino("true", "")
653         build_arduino("false", "")
654
655     elif str(sys.argv[1]) == "windows":
656         build_windows("true", "")
657         build_windows("false", "")
658
659     elif str(sys.argv[1]) == "msys":
660         build_msys("true", "")
661         build_msys("false", "")
662
663     elif str(sys.argv[1]) == "tizen":
664         build_tizen("true", "")
665         build_tizen("false", "")
666
667     elif str(sys.argv[1]) == "simulator":
668         build_simulator("true", "")
669         build_simulator("false", "")
670
671     elif str(sys.argv[1]) == "darwin":
672         build_darwin("true", "")
673         build_darwin("false", "")
674
675     elif str(sys.argv[1]) == "unit_tests":
676         unit_tests()
677
678     else:
679         helpmsg(script_name)
680 else:
681         helpmsg(script_name)
682
683 print ("===================== done =====================")