tiny_stdlib.parts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. """
  19. Import('*')
  20. env.PartName('tiny_stdlib')
  21. include_files = Pattern(src_dir='.', includes=['*.h'], recursive=False).files()
  22. src_files = Pattern(src_dir='src', includes=['*.c'], recursive=True).files()
  23. env.Append(CPPPATH='#')
  24. if 'shared' in env['MODE']:
  25. env.Append(CPPDEFINES=['SHARED'])
  26. outputs = env.Library('${PART_SHORT_NAME}', src_files)
  27. sdk_outs = env.Sdk(outputs)
  28. env.SdkInclude(include_files, sub_dir='${PART_SHORT_NAME}')
  29. if 'install_lib' in env['MODE'] and 'shared' not in env['MODE']:
  30. env.InstallLib(outputs)