2021-01-12 17:33:03 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
from glob import glob
|
2021-07-06 05:24:07 +02:00
|
|
|
from collections import defaultdict
|
2021-01-12 17:33:03 +01:00
|
|
|
import subprocess
|
2021-06-26 22:28:06 +02:00
|
|
|
import sys
|
2021-01-12 17:33:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2021-07-06 05:24:07 +02:00
|
|
|
keymaps = defaultdict(set)
|
|
|
|
|
2021-01-12 17:33:03 +01:00
|
|
|
for filename in glob("keyboards/**/vial.json", recursive=True):
|
|
|
|
filename = filename[10:-10]
|
2021-07-06 05:24:07 +02:00
|
|
|
keyboard, keymap = filename.split("/keymaps/")
|
|
|
|
keymaps[keyboard].add("default")
|
|
|
|
keymaps[keyboard].add(keymap)
|
|
|
|
|
|
|
|
failed = False
|
|
|
|
for keyboard, keymaps in keymaps.items():
|
|
|
|
for keymap in keymaps:
|
|
|
|
sys.stdout.write("==> Compiling {}:{}\n".format(keyboard, keymap))
|
|
|
|
sys.stdout.flush()
|
|
|
|
if subprocess.call(["make", "{}:{}".format(keyboard, keymap), "-j4"]) != 0:
|
|
|
|
failed = True
|
2021-06-26 22:28:06 +02:00
|
|
|
|
2021-07-06 05:24:07 +02:00
|
|
|
if failed:
|
|
|
|
sys.exit(1)
|
2021-01-12 17:33:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|