1-build.py 738 B

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