build_all_header_file.py 959 B

1234567891011121314151617181920212223242526272829
  1. #! /usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. import sys, os
  4. #----------------------------------------------------------------------------------------------------------------------*
  5. separator = "//" + ("—" * 118) + "\n"
  6. #------------------------------ Destination file
  7. destinationFile = sys.argv [1]
  8. #------------------------------ Dependence file
  9. dependenceFile = sys.argv [2]
  10. #------------------------------ Header files
  11. dependenceString = ""
  12. s = "#pragma once\n\n"
  13. s += separator + "\n"
  14. for i in range (3, len (sys.argv)):
  15. s += "#include \"" + os.path.basename (sys.argv [i]) + "\"\n"
  16. dependenceString += " :" + sys.argv [i] + "\n\n"
  17. s += "\n" + separator
  18. #------------------------------ Write files
  19. f = open (destinationFile, "wt")
  20. f.write (s)
  21. f.close()
  22. f = open (dependenceFile, "wt")
  23. f.write (dependenceString)
  24. f.close()
  25. #----------------------------------------------------------------------------------------------------------------------*