diff --git a/.gitignore b/.gitignore index 18c0f50..2cb6c03 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ bin/ examples/sandbox.txt +copy+paste.txt +.*.db diff --git a/build-all.py b/build-all.py new file mode 100755 index 0000000..9193288 --- /dev/null +++ b/build-all.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +import subprocess; +import time; +import atexit; +import os; +import pickle; + +PICKLEFILE = ".build-all.db" + +try: + with open(PICKLEFILE, "rb") as stream: + ftimes = pickle.load(stream); +except: + ftimes = dict(); + +def dumpftimes(): + with open(PICKLEFILE, "wb") as stream: + pickle.dump(ftimes, stream); + +atexit.register(dumpftimes); + +buildtypes = set(); + +for x in os.listdir("buildtypes"): + buildtype = x[:-4]; + + if buildtype not in ftimes: + ftimes[buildtype] = time.time(); + + buildtypes.add(buildtype); + +for buildtype in sorted(buildtypes, key = lambda x: -ftimes[x]): + print("\033[32m" f"$ make buildtype={buildtype}" "\033[0m"); + + result = subprocess.run(["make", f"buildtype={buildtype}"]); + + if result.returncode: + ftimes[buildtype] = time.time(); + print("subcommand failed!"); + exit(1); + + + + + + + + + + + + + + + + + +