Browse Source

You can now put binaries in bin_usr/ instead of adding them to $PATH

ijon 10 months ago
parent
commit
f395dde186
3 changed files with 18 additions and 8 deletions
  1. 2 1
      .gitignore
  2. 5 0
      README.md
  3. 11 7
      make.py

+ 2 - 1
.gitignore

@@ -1,3 +1,4 @@
 *.pyc
 dist/*
-build/*
+build/*
+bin_usr/*

+ 5 - 0
README.md

@@ -38,6 +38,11 @@ Linux needs these:
 - 7za  for packaging (check your distro's repositories for `p7zip` or `p7zip-full`)
 
 Install them normally - as long as the above are on your PATH, makepk3 will find them.
+Alternatively, you can put them in the following places:
+
+- GDCC: `bin_usr/gdcc/`
+- ACC:  `bin_usr/acc/`
+- 7za:  `bin_usr/`
 
 If GDCC is missing, `make.py` will not attempt to build anything in `pk3/gacs` or `pk3/gdcc`.
 

+ 11 - 7
make.py

@@ -11,12 +11,12 @@ from inc.basefuncs import *
 
 DIR_MINE = os.path.realpath(sys.argv[0]).rpartition(os.sep)[0]
 
-EXE_7ZIP         = findBinary("7za",          [os.path.join(DIR_MINE, "bin_win")])
-EXE_ACC          = findBinary("acc",          [os.path.join(DIR_MINE, "bin_win/acc")])
-EXE_GDCC_ACC     = findBinary("gdcc-acc",     [os.path.join(DIR_MINE, "bin_win/gdcc")])
-EXE_GDCC_CC      = findBinary("gdcc-cc",      [os.path.join(DIR_MINE, "bin_win/gdcc")])
-EXE_GDCC_LD      = findBinary("gdcc-ld",      [os.path.join(DIR_MINE, "bin_win/gdcc")])
-EXE_GDCC_MAKELIB = findBinary("gdcc-makelib", [os.path.join(DIR_MINE, "bin_win/gdcc")])
+EXE_7ZIP         = findBinary("7za",          [os.path.join(DIR_MINE, "bin_usr"),      os.path.join(DIR_MINE, "bin_win")])
+EXE_ACC          = findBinary("acc",          [os.path.join(DIR_MINE, "bin_usr/acc"),  os.path.join(DIR_MINE, "bin_win/acc")])
+EXE_GDCC_ACC     = findBinary("gdcc-acc",     [os.path.join(DIR_MINE, "bin_usr/gdcc"), os.path.join(DIR_MINE, "bin_win/gdcc")])
+EXE_GDCC_CC      = findBinary("gdcc-cc",      [os.path.join(DIR_MINE, "bin_usr/gdcc"), os.path.join(DIR_MINE, "bin_win/gdcc")])
+EXE_GDCC_LD      = findBinary("gdcc-ld",      [os.path.join(DIR_MINE, "bin_usr/gdcc"), os.path.join(DIR_MINE, "bin_win/gdcc")])
+EXE_GDCC_MAKELIB = findBinary("gdcc-makelib", [os.path.join(DIR_MINE, "bin_usr/gdcc"), os.path.join(DIR_MINE, "bin_win/gdcc")])
 
 ARGS_7ZIP_COMMON = ["-mx=9", "-x!*.ir", "-x!*.dbs", "-x!*.backup*", "-x!*.bak", "-x!desktop.ini"]
 ARGS_7ZIP_PK3    = ARGS_7ZIP_COMMON + ["-tzip"]
@@ -383,7 +383,11 @@ if __name__ == "__main__":
     args = parser.parse_args()
     
     if not os.path.isdir(args.dir):
-        print("\"{}\" is not a directory, aborting".format(args.dir), file=sys.stderr)
+        if os.path.exists(args.dir):
+            print("project path \"{}\" is not a folder, aborting".format(args.dir), file=sys.stderr)
+        else:
+            print("project path \"{}\" doesn't exist, aborting".format(args.dir), file=sys.stderr)
+        
         done(1)
 
     couldCompile = make(args.dir, args.obj, precompile=args.pre, recompile=args.recompile)