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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 target_os = env.get('TARGET_OS')
23 samples_env = env.Clone()
24 ######################################################################
26 ######################################################################
27 samples_env.PrependUnique(CPPPATH = [
28 '../../../../logger/include',
29 '../../../../stack/include',
30 '../../../../../../extlibs/cjson',
31 '../../../../../oc_logger/include',
32 '../../../../../connectivity/lib/libcoap-4.1.1'
35 samples_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
36 samples_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
37 samples_env.AppendUnique(LIBS = ['-lpthread' ])
38 samples_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
40 if target_os in ['darwin', 'ios']:
41 samples_env.PrependUnique(LIBS = ['m','octbstack', 'ocsrm', 'connectivity_abstraction','coap' ])
42 elif target_os not in ['arduino']:
43 samples_env.PrependUnique(LIBS = ['m', 'octbstack', 'ocsrm', 'oc_logger', 'connectivity_abstraction', 'coap'])
44 samples_env.AppendUnique(LIBS = ['rt'])
46 if env.get('SECURED') == '1':
47 samples_env.AppendUnique(LIBS = ['tinydtls'])
49 samples_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
51 ######################################################################
52 # Source files and Targets
53 ######################################################################
54 ocserver = samples_env.Program('ocserver', ['ocserver.cpp', 'common.cpp'])
55 occlient = samples_env.Program('occlient', ['occlient.cpp', 'common.cpp'])
56 ocserverslow = samples_env.Program('ocserverslow', ['ocserverslow.cpp', 'common.cpp'])
57 occlientslow = samples_env.Program('occlientslow', ['occlientslow.cpp', 'common.cpp'])
58 ocservercoll = samples_env.Program('ocservercoll', ['ocservercoll.cpp', 'common.cpp'])
59 occlientcoll = samples_env.Program('occlientcoll', ['occlientcoll.cpp', 'common.cpp'])
60 ocserverbasicops = samples_env.Program('ocserverbasicops', ['ocserverbasicops.cpp', 'common.cpp'])
61 occlientbasicops = samples_env.Program('occlientbasicops', ['occlientbasicops.cpp', 'common.cpp'])
63 Alias("samples", [ocserver, occlient,
64 ocservercoll, occlientcoll,
65 ocserverbasicops, occlientbasicops,
66 ocserverslow, occlientslow
69 env.AppendTarget('samples')