1 #******************************************************************
3 # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
11 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 thread_env = SConscript('#build_common/thread.scons')
22 samples_env = thread_env.Clone()
23 target_os = samples_env.get('TARGET_OS')
24 with_ra = samples_env.get ('WITH_RA')
26 ######################################################################
28 ######################################################################
29 samples_env.PrependUnique(CPPPATH = [
30 '../../../../logger/include',
31 '../../../../stack/include',
32 '../../../../../../extlibs/cjson',
33 '../../../../../../extlibs/boost/boost',
34 '../../../../../oc_logger/include',
35 '../../../../../connectivity/lib/libcoap-4.1.1'
38 compiler = samples_env.get('CXX')
40 samples_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
42 samples_env.AppendUnique(RPATH = [samples_env.get('BUILD_DIR')])
43 samples_env.AppendUnique(LIBPATH = [samples_env.get('BUILD_DIR')])
45 samples_env.PrependUnique(LIBS = ['octbstack', 'ocsrm', 'connectivity_abstraction', 'coap'])
47 if target_os not in ['arduino', 'windows', 'darwin', 'ios', 'msys_nt']:
48 samples_env.AppendUnique(LIBS = ['rt'])
50 if target_os not in ['windows']:
51 samples_env.PrependUnique(LIBS = ['m'])
53 if samples_env.get('SECURED') == '1':
54 samples_env.AppendUnique(LIBS = ['tinydtls'])
56 samples_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
58 ######################################################################
59 # Source files and Targets
60 ######################################################################
61 ocserver = samples_env.Program('ocserver', ['ocserver.cpp', 'common.cpp'])
62 if samples_env.get('ROUTING') == 'GW':
63 ocrouting = samples_env.Program('ocrouting', ['ocrouting.cpp', 'common.cpp'])
64 occlient = samples_env.Program('occlient', ['occlient.cpp', 'common.cpp'])
65 ocserverslow = samples_env.Program('ocserverslow', ['ocserverslow.cpp', 'common.cpp'])
66 occlientslow = samples_env.Program('occlientslow', ['occlientslow.cpp', 'common.cpp'])
67 ocservercoll = samples_env.Program('ocservercoll', ['ocservercoll.cpp', 'common.cpp'])
68 occlientcoll = samples_env.Program('occlientcoll', ['occlientcoll.cpp', 'common.cpp'])
69 ocserverbasicops = samples_env.Program('ocserverbasicops', ['ocserverbasicops.cpp', 'common.cpp'])
70 occlientbasicops = samples_env.Program('occlientbasicops', ['occlientbasicops.cpp', 'common.cpp'])
72 ocremoteaccessclient = samples_env.Program('ocremoteaccessclient',
73 ['ocremoteaccessclient.cpp','common.cpp'])
75 list_of_samples = [ocserver, occlient,
76 ocservercoll, occlientcoll,
77 ocserverbasicops, occlientbasicops,
78 ocserverslow, occlientslow
81 list_of_samples.append (ocremoteaccessclient)
82 Alias("samples", list_of_samples)
84 samples_env.AppendTarget('samples')