replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / tool / 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 Import('env')
22 import os
23
24 tools_env = env.Clone()
25 src_dir = tools_env.get('SRC_DIR')
26 target_os = tools_env.get('TARGET_OS')
27
28 ######################################################################
29 # Build flags
30 ######################################################################
31 with_upstream_libcoap = tools_env.get('WITH_UPSTREAM_LIBCOAP')
32 if with_upstream_libcoap == '1':
33     # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded.
34     tools_env.AppendUnique(CPPPATH = ['#/extlibs/libcoap/libcoap/include'])
35 else:
36     # For bring up purposes only, the forked version will live here.
37     tools_env.AppendUnique(CPPPATH = ['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
38
39 tools_env.PrependUnique(CPPPATH = [
40     '#/extlibs/cjson',
41     '#/resource/csdk/stack/include',
42     '#/resource/csdk/stack/include/internal',
43     '#/resource/csdk/logger/include',
44     '#/resource/oc_logger/include',
45     '#/resource/csdk/connectivity/api',
46     '#/resource/csdk/connectivity/inc/pkix',
47     '#/resource/csdk/security/include',
48     '#/resource/csdk/security/include/internal',
49     '#/resource/csdk/security/provisioning/include',
50     '#/resource/csdk/security/provisioning/include/internal'
51 ])
52 tools_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
53 tools_env.AppendUnique(RPATH = [tools_env.get('BUILD_DIR')])
54 tools_env.AppendUnique(LIBPATH = [tools_env.get('BUILD_DIR')])
55 tools_env.PrependUnique(LIBS = ['oc', 'octbstack', 'mbedtls', 'mbedx509', 'mbedcrypto'])
56
57 if tools_env.get('MULTIPLE_OWNER') == '1':
58         tools_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
59
60 ######################################################################
61 # Source files and Targets
62 ######################################################################
63 json2cbor = tools_env.Program('json2cbor', ['json2cbor.c'])
64
65 SVRDBEDITOR_DIR = 'svrdbeditor_src/'
66 svrdbeditor_src = [
67     SVRDBEDITOR_DIR + 'svrdbeditorcommon.c',
68     SVRDBEDITOR_DIR + 'svrdbeditoracl.c',
69     SVRDBEDITOR_DIR + 'svrdbeditorcred.c',
70     SVRDBEDITOR_DIR + 'svrdbeditordoxm.c',
71     SVRDBEDITOR_DIR + 'svrdbeditorpstat.c',
72     SVRDBEDITOR_DIR + 'svrdbeditor.c'
73 ]
74
75 svrdbeditor = tools_env.Program("svrdbeditor", svrdbeditor_src)
76 Alias("securitytool", [json2cbor, svrdbeditor])
77 tools_env.AppendTarget('securitytool')