jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6KB

  1. #!/usr/bin/python3
  2. # encoding: utf-8
  3. #
  4. # Copyright (C) 2018 Karl Linden <karl.j.linden@gmail.com>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #
  19. import os
  20. def get_subdirs(ctx):
  21. """
  22. Get the compatibility module subirectories.
  23. The compat modules are found dynamically so that this script does
  24. not have to be modified if more modules are added.
  25. :param ctx: the waf context
  26. :type ctx: waflib.Context.Context
  27. :returns: list of str -- the subdirectories
  28. """
  29. subdirs = []
  30. for entry in ctx.path.listdir():
  31. path = os.path.join(ctx.path.abspath(), entry)
  32. if os.path.isdir(path) and not entry.startswith('.'):
  33. subdirs.append(entry)
  34. return subdirs
  35. def recurse_into_subdirs(ctx):
  36. """
  37. Recurse into compatibility module subdirectories.
  38. :param ctx: the waf context
  39. :type ctx: waflib.Context.Context
  40. """
  41. for x in get_subdirs(ctx):
  42. ctx.recurse(x)
  43. def options(opt):
  44. recurse_into_subdirs(opt)
  45. def configure(conf):
  46. recurse_into_subdirs(conf)
  47. def build(bld):
  48. recurse_into_subdirs(bld)