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 tools_env = env.Clone()
25 src_dir = tools_env.get('SRC_DIR')
26 target_os = tools_env.get('TARGET_OS')
28 ######################################################################
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'])
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'])
39 tools_env.PrependUnique(CPPPATH = [
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'
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'])
57 if tools_env.get('MULTIPLE_OWNER') == '1':
58 tools_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
60 ######################################################################
61 # Source files and Targets
62 ######################################################################
63 json2cbor = tools_env.Program('json2cbor', ['json2cbor.c'])
65 SVRDBEDITOR_DIR = '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'
75 svrdbeditor = tools_env.Program("svrdbeditor", svrdbeditor_src)
76 Alias("securitytool", [json2cbor, svrdbeditor])
77 tools_env.AppendTarget('securitytool')