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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 target_os = env.get('TARGET_OS')
25 target_arch = env.get('TARGET_ARCH')
26 samples_env = env.Clone()
27 src_dir = env.get('SRC_DIR')
28 pi_dir = os.path.join(src_dir, 'plugins')
30 ######################################################################
32 ######################################################################
33 samples_env.PrependUnique(CPPPATH = [
34 os.path.join(src_dir, 'resource', 'oc_logger', 'include'),
35 os.path.join(src_dir, 'resource', 'csdk', 'logger', 'include'),
36 os.path.join(src_dir, 'resource', 'csdk', 'stack', 'include'),
37 os.path.join(pi_dir, 'include')
40 samples_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-Wextra', '-Werror'])
41 samples_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
42 samples_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
44 if target_os in ['darwin', 'ios']:
45 samples_env.PrependUnique(LIBS = ['m',
48 'connectivity_abstraction',
50 elif target_os not in ['arduino']:
51 samples_env.PrependUnique(LIBS = ['m',
54 'connectivity_abstraction',
57 samples_env.AppendUnique(LIBS = ['rt'])
58 if target_arch in ['x86_64', 'arm64']:
59 samples_env.AppendUnique(CPPFLAGS = ['-Llib64'])
61 samples_env.AppendUnique(CPPFLAGS = ['-Llib'])
62 samples_env.AppendUnique(LIBS = ['pthread'])
64 if env.get('SECURED') == '1':
65 samples_env.AppendUnique(LIBS = ['tinydtls'])
67 samples_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
69 ######################################################################
70 # Source files and Targets
71 ######################################################################
72 iotivityandzigbeeserver = samples_env.Program('iotivityandzigbeeserver',
73 ['IotivityandZigbeeServer.c'])
74 iotivityandzigbeeclient = samples_env.Program('iotivityandzigbeeclient',
75 ['IotivityandZigbeeClient.c'])
77 list_of_samples = [iotivityandzigbeeserver, iotivityandzigbeeclient]
79 Alias("samples", list_of_samples)
81 env.AppendTarget('samples')