Merge branch 'master' into easysetup & CBOR changes
[platform/upstream/iotivity.git] / service / easy-setup / sampleapp / arduino / thinserver / 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 thinserver_env = env.Clone()
24 ######################################################################
25 # Build flags
26 ######################################################################
27 thinserver_env.PrependUnique(CPPPATH = [
28                 '../../../../../resource/oc_logger/include',
29                 '../../../../../resource/csdk/logger/include',
30                 '../../../../../resource/csdk/stack/include',
31                 '../../../../../extlibs/cjson',
32                 '../../../sdk/common',
33                 '../../../sdk/enrollee/arduino/wifi',
34                 '../../../sdk/enrollee/common/inc',
35                 '../../../sdk/enrollee/common/src'
36                 ])
37
38 thinserver_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
39 thinserver_env.AppendUnique(CPPDEFINES = ['TB_LOG', 'ARDUINOWIFI'])
40
41 thinserver_env.PrependUnique(LIBS = ['octbstack','ocsrm','connectivity_abstraction','coap', 'ESSDKLibrary'])
42
43 thinserver = thinserver_env.Program('thinserver', 'thinserver.cpp')
44 env.CreateBin('thinserver')
45
46 i_thinserver = thinserver_env.Install(env.get('BUILD_DIR'), thinserver)
47
48 Alias('thinserver', i_thinserver)
49 env.AppendTarget('thinserver')
50
51 if(thinserver_env['UPLOAD'] == True):
52         from sys import platform as _platform
53         if _platform == "linux" or _platform == "linux2":
54                 thinserver_env.Upload(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/arduino/thinserver/thinserver.hex')
55         else:
56                 print 'Please use appropriate install method for your developing machine. Linux is the only supported platform right now.'