Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / resource / csdk / stack / samples / arduino / SimpleClientServer / ocserver / 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 transport = env.get('TARGET_TRANSPORT')
24 if 'BLE' in transport:
25         # Only supported for ethernet and WiFi.
26         Return()
27
28 arduino_simplecs_env = env.Clone()
29 ######################################################################
30 # Build flags
31 ######################################################################
32 arduino_simplecs_env.PrependUnique(CPPPATH = [
33                 '../../../../../logger/include',
34                 '../../../../../stack/include',
35                 '../../../../../../oc_logger/include'
36                 ])
37
38 arduino_simplecs_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
39 arduino_simplecs_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
40
41 arduino_simplecs_env.PrependUnique(LIBS = ['octbstack', 'ocsrm', 'connectivity_abstraction','coap'])
42
43 arduino_simplecs = arduino_simplecs_env.Program('SimpleClientServer', 'ocserver.cpp')
44 env.CreateBin('SimpleClientServer')
45
46 i_arduino_simplecs = arduino_simplecs_env.Install(env.get('BUILD_DIR'), arduino_simplecs)
47
48 #The map file is intermediate file, make sure it's removed when clean build
49 arduino_simplecs_env.Clean(arduino_simplecs, 'SimpleClientServer.map')
50
51 Alias('arduino_simplecs', i_arduino_simplecs)
52 env.AppendTarget('arduino_simplecs')
53
54 if(arduino_simplecs_env['UPLOAD'] == True):
55         from sys import platform as _platform
56         if _platform == "linux" or _platform == "linux2":
57                 arduino_simplecs_env.Upload(env.get('BUILD_DIR') + '/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SimpleClientServer.hex')
58         else:
59                 print 'Please use appropriate install method for your developing machine. Linux is the only supported platform right now.'