build.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. from Naked.toolshed.system import exit_success
  4. #------------------------------------------------------------------------------
  5. # [ compile_c_code function ] (--none--)
  6. # compile C files in the lib/Naked/toolshed/c directory
  7. #------------------------------------------------------------------------------
  8. def compile_c_code(abs_dirpath):
  9. from Naked.toolshed.shell import execute
  10. from os import chdir
  11. chdir(abs_dirpath)
  12. print('•naked• Compiling the C source library files...')
  13. success = execute("python setup.py build_ext --inplace")
  14. if success:
  15. print(' ')
  16. print('•naked• C source code compile complete.')
  17. exit_success()
  18. def help():
  19. help_string = """
  20. Naked build Command Help
  21. ========================
  22. The build command compiles the Naked C libraries. This requires an installed C compiler.
  23. USAGE
  24. naked build
  25. SECONDARY COMMANDS
  26. none
  27. OPTIONS
  28. none"""
  29. print(help_string)
  30. exit_success()
  31. if __name__ == '__main__':
  32. pass