1# pylint:disable=I0011,W0401,W0614,C0103,E0602
2############################################################################
3# Copyright 2017 Intel Corporation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16############################################################################
17"""Build configuration for tiny standard library.
18"""
19Import('*')
20env.PartName('tiny_stdlib')
21
22include_files = Pattern(src_dir='.', includes=['*.h'], recursive=False).files()
23
24src_files = Pattern(src_dir='src', includes=['*.c'], recursive=True).files()
25
26env.Append(CPPPATH='#')
27
28if 'shared' in env['MODE']:
29    env.Append(CPPDEFINES=['SHARED'])
30
31outputs = env.Library('${PART_SHORT_NAME}', src_files)
32
33sdk_outs = env.Sdk(outputs)
34env.SdkInclude(include_files, sub_dir='${PART_SHORT_NAME}')
35
36if 'install_lib' in env['MODE'] and 'shared' not in env['MODE']:
37    env.InstallLib(outputs)
38