46e270ef3f221f06c4854a7cf96a9ae3d5458291
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / sample / SConscript
1 # //******************************************************************
2 # //
3 # // Copyright 2015 Samsung Electronics 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
22 Import('env')
23
24 provisioning_env = env.Clone()
25
26 ######################################################################
27 # Build flags
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',
37                 '../include',
38                 '../include/oxm',
39                 '../../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'
47                 ])
48
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'])
55
56 if env.get('SECURED') == '1':
57     provisioning_env.AppendUnique(LIBS = ['tinydtls'])
58 provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
59
60 provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
61
62 ######################################################################
63 # Source files and Targets
64 ######################################################################
65
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')
69
70 Alias("samples", [provisioningclient, sampleserver_justworks, sampleserver_randompin])
71
72 provisioning_env.AppendTarget('samples')
73
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/'
77
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'))