53b2dbff9d53ee3ae7af0104e577cfa728fc5e2a
[platform/upstream/iotivity.git] / service / easy-setup / sampleapp / enrollee / arduino / SConscript
1 #******************************************************************
2 #
3 # Copyright 2015 Samsung Electronics All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 Import('env')
22
23 enrollee_env = env.Clone()
24 transport = enrollee_env.get('TARGET_TRANSPORT')
25
26 ######################################################################
27 # Build flags
28 ######################################################################
29 enrollee_env.PrependUnique(CPPPATH = [
30         '../../../../../resource/oc_logger/include',
31         '../../../../../resource/csdk/logger/include',
32         '../../../../../resource/csdk/stack/include',
33         '../../../../../extlibs/cjson',
34         '../../../sdk/common',
35         '../../../sdk/enrollee/arduino/wifi',
36         '../../../sdk/enrollee/api',
37         '../../../sdk/enrollee/inc',
38         '../../../sdk/enrollee/src'
39         ])
40 enrollee_env.AppendUnique(CPPDEFINES = ['TB_LOG', 'ESWIFI'])
41         
42 enrollee_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
43
44 enrollee_env.PrependUnique(LIBS = ['octbstack','ocsrm','connectivity_abstraction','coap', 'ESSDKLibrary'])
45 enrollee = enrollee_env.Program('enrollee', 'enrolleewifi.cpp')
46 env.CreateBin('enrollee')
47
48 i_enrollee = enrollee_env.Install(env.get('BUILD_DIR'), enrollee)
49
50 Alias('enrollee', i_enrollee)
51 env.AppendTarget('enrollee')
52
53 if(enrollee_env['UPLOAD'] == True):
54         from sys import platform as _platform
55         if _platform == "linux" or _platform == "linux2":
56                 enrollee_env.Upload(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/arduino/enrollee.hex')
57         else:
58                 print 'Please use appropriate install method for your developing machine. Linux is the only supported platform right now.'