1-build.py 1.3 KB

123456789101112131415161718192021222324252627282930
  1. #! /usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. #----------------------------------------------------------------------------------------------------------------------*
  4. import sys, os, json
  5. #----------------------------------------------------------------------------------------------------------------------*
  6. #----------------------------------------------------------------- Get script absolute path
  7. scriptDir = os.path.dirname (os.path.abspath (sys.argv [0]))
  8. os.chdir (scriptDir)
  9. #----------------------------------------------------------------- Get max parallel jobs as first argument
  10. goal = "all"
  11. if len (sys.argv) > 1 :
  12. goal = sys.argv [1]
  13. #----------------------------------------------------------------- Get max parallel jobs as first argument
  14. maxParallelJobs = 0 # 0 means use host processor count
  15. if len (sys.argv) > 2 :
  16. maxParallelJobs = int (sys.argv [2])
  17. #----------------------------------------------------------------- Build
  18. jsonFilePath = os.path.abspath (scriptDir + "/makefile.json")
  19. f = open (jsonFilePath, "r")
  20. dictionary = json.loads (f.read ())
  21. f.close ()
  22. sys.path.append (scriptDir + "/../../dev-files")
  23. import code_builder
  24. code_builder.buildCode (goal, scriptDir, maxParallelJobs, maxParallelJobs == 1)
  25. #----------------------------------------------------------------------------------------------------------------------*