dropt.parts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ############################################################################
  2. # Copyright 2016 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################
  16. Import('*')
  17. env.PartVersion("1.1.1")
  18. env.PartName("dropt")
  19. # sourcefiles
  20. src_files = Pattern(src_dir='src/',
  21. includes=['*.c'],
  22. excludes=['test_*'],
  23. recursive=True).files()
  24. #includes to install
  25. install_headers = Pattern(src_dir='include/',
  26. includes=['dropt.h'],
  27. recursive=True).files()
  28. internal_headers = Pattern(src_dir='include/',
  29. includes=['dropt_string.h'],
  30. recursive=True).files()
  31. parts_file = ['dropt.parts']
  32. license_file = ['LICENSE']
  33. makefile = ['Makefile']
  34. if 'install_package' in env['MODE']:
  35. env.InstallTopLevel(src_files, sub_dir='ext/dropt/src')
  36. env.InstallTopLevel(install_headers + internal_headers,
  37. sub_dir='ext/dropt/include')
  38. env.InstallTopLevel(parts_file, sub_dir='ext/dropt')
  39. env.InstallTopLevel(license_file, sub_dir='ext/dropt')
  40. env.InstallTopLevel(makefile, sub_dir='ext/dropt')
  41. else:
  42. env.Append(CPPPATH=[AbsDir('include')])
  43. outputs = env.Library('${PART_NAME}', src_files)
  44. sdk_outs = env.Sdk(outputs)
  45. env.SdkInclude(install_headers)