1 # //******************************************************************
3 # // Copyright 2015 Samsung Electronics 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 provisioning_env = env.Clone()
26 ######################################################################
28 ######################################################################
29 provisioning_env.AppendUnique(CPPPATH = [
30 '../../../stack/include',
31 '../../../ocrandom/include',
32 '../../../logger/include',
33 '../../../stack/include',
34 '../../../security/include',
35 '../../../security/provisioning/include/internal',
36 '../../../../oc_logger/include',
40 '../../../../../extlibs/tinydtls',
41 '../../../../../extlibs/cjson',
42 '../../../../../extlibs/base64',
43 '../../../connectivity/inc',
44 '../../../connectivity/common/inc',
45 '../../../connectivity/lib/libcoap-4.1.1',
46 '../../../connectivity/api'
49 provisioning_env.AppendUnique(CFLAGS = ['-D__WITH_DTLS__','-std=c99'])
50 provisioning_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread', '-fpermissive'])
51 provisioning_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
52 provisioning_env.AppendUnique(LIBS = ['-lpthread'])
53 provisioning_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
54 provisioning_env.PrependUnique(LIBS = ['ocpmapi','oc', 'oc_logger', 'ocsrm','m', 'octbstack', 'connectivity_abstraction', 'coap'])
56 if env.get('SECURED') == '1':
57 provisioning_env.AppendUnique(LIBS = ['tinydtls'])
58 provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
60 provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
62 ######################################################################
63 # Source files and Targets
64 ######################################################################
66 provisioningclient = provisioning_env.Program('provisioningclient', 'provisioningclient.c')
67 sampleserver_justworks = provisioning_env.Program('sampleserver_justworks', 'sampleserver_justworks.cpp')
68 sampleserver_randompin = provisioning_env.Program('sampleserver_randompin', 'sampleserver_randompin.cpp')
70 Alias("samples", [provisioningclient, sampleserver_justworks, sampleserver_randompin])
72 provisioning_env.AppendTarget('samples')
74 src_dir = provisioning_env.get('SRC_DIR')
75 sec_provisioning_src_dir = src_dir + '/resource/csdk/security/provisioning/sample/'
76 sec_provisioning_build_dir = env.get('BUILD_DIR') +'/resource/csdk/security/provisioning/sample/'
78 provisioning_env.Alias("install", provisioning_env.Install( sec_provisioning_build_dir,
79 sec_provisioning_src_dir + 'oic_svr_db_client.json'))
80 provisioning_env.Alias("install", provisioning_env.Install( sec_provisioning_build_dir,
81 sec_provisioning_src_dir + 'oic_svr_db_server_justworks.json'))
82 provisioning_env.Alias("install", provisioning_env.Install( sec_provisioning_build_dir,
83 sec_provisioning_src_dir + 'oic_svr_db_server_randompin.json'))