f9c5bf0b7e909d0077fee7c0b21ad90330bbe2f5
[platform/upstream/iotivity.git] / service / easy-setup / sampleapp / enrollee / arduino / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 Intel Mobile Communications GmbH 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/common/inc',
37         '../../../sdk/enrollee/common/src'
38         ])
39 enrollee_env.AppendUnique(CPPDEFINES = ['TB_LOG', 'ESWIFI'])
40         
41 enrollee_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
42
43 enrollee_env.PrependUnique(LIBS = ['octbstack','ocsrm','connectivity_abstraction','coap', 'ESSDKLibrary'])
44 enrollee = enrollee_env.Program('enrollee', 'enrollee_wifi.cpp')
45 env.CreateBin('enrollee')
46
47 i_enrollee = enrollee_env.Install(env.get('BUILD_DIR'), enrollee)
48
49 Alias('enrollee', i_enrollee)
50 env.AppendTarget('enrollee')
51
52 if(enrollee_env['UPLOAD'] == True):
53         from sys import platform as _platform
54         if _platform == "linux" or _platform == "linux2":
55                 enrollee_env.Upload(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/arduino/enrollee.hex')
56         else:
57                 print 'Please use appropriate install method for your developing machine. Linux is the only supported platform right now.'