From 15a69f6dcbdb8126ddba14094fc5d56b9866249d Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 17 Mar 2025 22:33:54 +0100 Subject: [PATCH] Make build with the new ab --- but the tests fail. --- arch/aeslanier/decoder.cc | 2 +- arch/agat/agat.cc | 2 +- arch/agat/decoder.cc | 2 +- arch/agat/encoder.cc | 2 +- arch/amiga/amiga.cc | 2 +- arch/amiga/decoder.cc | 2 +- arch/amiga/encoder.cc | 2 +- arch/apple2/decoder.cc | 2 +- arch/arch.cc | 2 +- arch/brother/decoder.cc | 2 +- arch/brother/encoder.cc | 2 +- arch/build.py | 4 +- arch/c64/c64.cc | 2 +- arch/c64/decoder.cc | 2 +- arch/c64/encoder.cc | 2 +- arch/f85/decoder.cc | 2 +- arch/fb100/decoder.cc | 2 +- arch/ibm/decoder.cc | 2 +- arch/ibm/encoder.cc | 2 +- arch/macintosh/decoder.cc | 2 +- arch/macintosh/encoder.cc | 2 +- arch/micropolis/decoder.cc | 2 +- arch/micropolis/encoder.cc | 2 +- arch/northstar/decoder.cc | 2 +- arch/northstar/encoder.cc | 2 +- arch/rolandd20/decoder.cc | 2 +- arch/smaky6/decoder.cc | 2 +- arch/tids990/decoder.cc | 2 +- arch/tids990/encoder.cc | 2 +- arch/victor9k/decoder.cc | 2 +- arch/victor9k/encoder.cc | 2 +- arch/zilogmcz/decoder.cc | 2 +- build.py | 6 +-- build/ab.mk | 2 + build/ab.py | 86 +++++++++++++++++++++++++++++++----- build/c.py | 46 +++++++++++++------ build/pkg.py | 2 +- build/protobuf.py | 16 +++---- build/utils.py | 6 +-- build/zip.py | 18 ++------ dep/hfsutils/build.py | 11 +++++ extras/build.py | 8 ++-- lib/external/greaseweazle.cc | 2 +- lib/usb/applesauceusb.cc | 4 +- lib/usb/build.py | 2 +- lib/usb/fluxengineusb.cc | 2 +- lib/usb/greaseweazleusb.cc | 4 +- lib/usb/serial.cc | 4 +- lib/usb/usb.cc | 4 +- lib/usb/usbfinder.cc | 4 +- lib/vfs/vfs.cc | 2 +- scripts/build.py | 4 +- src/build.py | 2 + src/formats/build.py | 4 +- src/gui/build.py | 59 +++++++++---------------- src/gui/drivetypes/build.py | 2 +- tests/build.py | 2 +- 57 files changed, 220 insertions(+), 148 deletions(-) diff --git a/arch/aeslanier/decoder.cc b/arch/aeslanier/decoder.cc index ca6ba0e6..7dc53e11 100644 --- a/arch/aeslanier/decoder.cc +++ b/arch/aeslanier/decoder.cc @@ -1,6 +1,6 @@ #include "lib/core/globals.h" #include "lib/decoders/decoders.h" -#include "aeslanier.h" +#include "arch/aeslanier/aeslanier.h" #include "lib/core/crc.h" #include "lib/data/fluxmap.h" #include "lib/data/fluxmapreader.h" diff --git a/arch/agat/agat.cc b/arch/agat/agat.cc index cbad00ab..662d059a 100644 --- a/arch/agat/agat.cc +++ b/arch/agat/agat.cc @@ -1,6 +1,6 @@ #include "lib/core/globals.h" #include "lib/decoders/decoders.h" -#include "agat.h" +#include "arch/agat/agat.h" #include "lib/core/bytes.h" #include "fmt/format.h" diff --git a/arch/agat/decoder.cc b/arch/agat/decoder.cc index 9bc223b4..7bc53d62 100644 --- a/arch/agat/decoder.cc +++ b/arch/agat/decoder.cc @@ -1,6 +1,6 @@ #include "lib/core/globals.h" #include "lib/decoders/decoders.h" -#include "agat.h" +#include "arch/agat/agat.h" #include "lib/core/crc.h" #include "lib/data/fluxmap.h" #include "lib/data/fluxmapreader.h" diff --git a/arch/agat/encoder.cc b/arch/agat/encoder.cc index 4ece7bab..cf6c8dd3 100644 --- a/arch/agat/encoder.cc +++ b/arch/agat/encoder.cc @@ -2,7 +2,7 @@ #include "lib/core/utils.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "agat.h" +#include "arch/agat/agat.h" #include "lib/core/crc.h" #include "lib/data/image.h" #include "lib/data/layout.h" diff --git a/arch/amiga/amiga.cc b/arch/amiga/amiga.cc index 6644e302..0f87b821 100644 --- a/arch/amiga/amiga.cc +++ b/arch/amiga/amiga.cc @@ -1,6 +1,6 @@ #include "lib/core/globals.h" #include "lib/decoders/decoders.h" -#include "amiga.h" +#include "arch/amiga/amiga.h" #include "lib/core/bytes.h" #include "fmt/format.h" diff --git a/arch/amiga/decoder.cc b/arch/amiga/decoder.cc index a7da662a..9c77c106 100644 --- a/arch/amiga/decoder.cc +++ b/arch/amiga/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "amiga.h" +#include "arch/amiga/amiga.h" #include "lib/core/bytes.h" #include "fmt/format.h" #include "lib/decoders/decoders.pb.h" diff --git a/arch/amiga/encoder.cc b/arch/amiga/encoder.cc index 6a1f5bb1..a9c66f6a 100644 --- a/arch/amiga/encoder.cc +++ b/arch/amiga/encoder.cc @@ -2,7 +2,7 @@ #include "lib/core/utils.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "amiga.h" +#include "arch/amiga/amiga.h" #include "lib/core/crc.h" #include "lib/data/image.h" #include "arch/amiga/amiga.pb.h" diff --git a/arch/apple2/decoder.cc b/arch/apple2/decoder.cc index 1a73ef33..120c6356 100644 --- a/arch/apple2/decoder.cc +++ b/arch/apple2/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "apple2.h" +#include "arch/apple2/apple2.h" #include "arch/apple2/apple2.pb.h" #include "lib/decoders/decoders.pb.h" #include "lib/core/bytes.h" diff --git a/arch/arch.cc b/arch/arch.cc index 58bc7515..95ad708f 100644 --- a/arch/arch.cc +++ b/arch/arch.cc @@ -18,7 +18,7 @@ #include "arch/rolandd20/rolandd20.h" #include "arch/smaky6/smaky6.h" #include "arch/tartu/tartu.h" -#include "arch/tids990/tids990.h" +#include "arch/tids990/tids990" #include "arch/victor9k/victor9k.h" #include "arch/zilogmcz/zilogmcz.h" #include "arch/arch.h" diff --git a/arch/brother/decoder.cc b/arch/brother/decoder.cc index d0658071..3827ae83 100644 --- a/arch/brother/decoder.cc +++ b/arch/brother/decoder.cc @@ -4,7 +4,7 @@ #include "lib/data/fluxpattern.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "brother.h" +#include "arch/brother/brother.h" #include "lib/data/sector.h" #include "lib/core/bytes.h" #include "lib/core/crc.h" diff --git a/arch/brother/encoder.cc b/arch/brother/encoder.cc index f41cf98a..cdaeb144 100644 --- a/arch/brother/encoder.cc +++ b/arch/brother/encoder.cc @@ -2,7 +2,7 @@ #include "lib/core/utils.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "brother.h" +#include "arch/brother/brother.h" #include "lib/core/crc.h" #include "lib/data/image.h" #include "arch/brother/brother.pb.h" diff --git a/arch/build.py b/arch/build.py index d3a53e61..a953cbec 100644 --- a/arch/build.py +++ b/arch/build.py @@ -46,6 +46,7 @@ cxxlibrary( "./apple2/encoder.cc", "./brother/decoder.cc", "./brother/encoder.cc", + "./brother/header_gcr.h", "./c64/c64.cc", "./c64/decoder.cc", "./c64/encoder.cc", @@ -55,6 +56,7 @@ cxxlibrary( "./ibm/encoder.cc", "./macintosh/decoder.cc", "./macintosh/encoder.cc", + "./macintosh/data_gcr.h", "./micropolis/decoder.cc", "./micropolis/encoder.cc", "./mx/decoder.cc", @@ -76,7 +78,7 @@ cxxlibrary( "arch/apple2/apple2.h": "./apple2/apple2.h", "arch/amiga/amiga.h": "./amiga/amiga.h", "arch/smaky6/smaky6.h": "./smaky6/smaky6.h", - "arch/tids990/tids990.h": "./tids990/tids990.h", + "arch/tids990/tids990": "./tids990/tids990.h", "arch/zilogmcz/zilogmcz.h": "./zilogmcz/zilogmcz.h", "arch/amiga/amiga.h": "./amiga/amiga.h", "arch/f85/data_gcr.h": "./f85/data_gcr.h", diff --git a/arch/c64/c64.cc b/arch/c64/c64.cc index 88fc8209..a8e81cd2 100644 --- a/arch/c64/c64.cc +++ b/arch/c64/c64.cc @@ -1,5 +1,5 @@ #include "lib/core/globals.h" -#include "c64.h" +#include "arch/c64/c64.h" /* * Track Sectors/track # Sectors Storage in Bytes Clock rate diff --git a/arch/c64/decoder.cc b/arch/c64/decoder.cc index fe05bc95..aca2f099 100644 --- a/arch/c64/decoder.cc +++ b/arch/c64/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "c64.h" +#include "arch/c64/c64.h" #include "lib/core/crc.h" #include "lib/core/bytes.h" #include "fmt/format.h" diff --git a/arch/c64/encoder.cc b/arch/c64/encoder.cc index 0bf45e0b..6ca2e9ec 100644 --- a/arch/c64/encoder.cc +++ b/arch/c64/encoder.cc @@ -2,7 +2,7 @@ #include "lib/core/utils.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "c64.h" +#include "arch/c64/c64.h" #include "lib/core/crc.h" #include "lib/data/sector.h" #include "lib/data/image.h" diff --git a/arch/f85/decoder.cc b/arch/f85/decoder.cc index 407a709d..69867cea 100644 --- a/arch/f85/decoder.cc +++ b/arch/f85/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "f85.h" +#include "arch/f85/f85.h" #include "lib/core/crc.h" #include "lib/core/bytes.h" #include "fmt/format.h" diff --git a/arch/fb100/decoder.cc b/arch/fb100/decoder.cc index c11edfea..d47c06ef 100644 --- a/arch/fb100/decoder.cc +++ b/arch/fb100/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "fb100.h" +#include "arch/fb100/fb100.h" #include "lib/core/crc.h" #include "lib/core/bytes.h" #include "lib/decoders/rawbits.h" diff --git a/arch/ibm/decoder.cc b/arch/ibm/decoder.cc index fcc08cb6..a08ef9b5 100644 --- a/arch/ibm/decoder.cc +++ b/arch/ibm/decoder.cc @@ -1,6 +1,6 @@ #include "lib/core/globals.h" #include "lib/decoders/decoders.h" -#include "ibm.h" +#include "arch/ibm/ibm.h" #include "lib/core/crc.h" #include "lib/data/fluxmap.h" #include "lib/data/fluxmapreader.h" diff --git a/arch/ibm/encoder.cc b/arch/ibm/encoder.cc index 25c3496a..d8b17976 100644 --- a/arch/ibm/encoder.cc +++ b/arch/ibm/encoder.cc @@ -2,7 +2,7 @@ #include "lib/config/config.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "ibm.h" +#include "arch/ibm/ibm.h" #include "lib/core/crc.h" #include "lib/data/image.h" #include "arch/ibm/ibm.pb.h" diff --git a/arch/macintosh/decoder.cc b/arch/macintosh/decoder.cc index fa8831fe..a1ff993a 100644 --- a/arch/macintosh/decoder.cc +++ b/arch/macintosh/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "macintosh.h" +#include "arch/macintosh/macintosh.h" #include "lib/core/bytes.h" #include "fmt/format.h" #include diff --git a/arch/macintosh/encoder.cc b/arch/macintosh/encoder.cc index 75fd59a3..57b66e96 100644 --- a/arch/macintosh/encoder.cc +++ b/arch/macintosh/encoder.cc @@ -2,7 +2,7 @@ #include "lib/core/utils.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "macintosh.h" +#include "arch/macintosh/macintosh.h" #include "lib/core/crc.h" #include "lib/data/image.h" #include "fmt/format.h" diff --git a/arch/micropolis/decoder.cc b/arch/micropolis/decoder.cc index ec1bc130..cf49ea24 100644 --- a/arch/micropolis/decoder.cc +++ b/arch/micropolis/decoder.cc @@ -4,7 +4,7 @@ #include "lib/data/fluxpattern.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "micropolis.h" +#include "arch/micropolis/micropolis.h" #include "lib/core/bytes.h" #include "fmt/format.h" #include "lib/decoders/decoders.pb.h" diff --git a/arch/micropolis/encoder.cc b/arch/micropolis/encoder.cc index da32ef4c..ed8706b8 100644 --- a/arch/micropolis/encoder.cc +++ b/arch/micropolis/encoder.cc @@ -1,5 +1,5 @@ #include "lib/core/globals.h" -#include "micropolis.h" +#include "arch/micropolis/micropolis.h" #include "lib/data/sector.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" diff --git a/arch/northstar/decoder.cc b/arch/northstar/decoder.cc index cf86cf66..ac99e35a 100644 --- a/arch/northstar/decoder.cc +++ b/arch/northstar/decoder.cc @@ -17,7 +17,7 @@ #include "lib/data/fluxpattern.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "northstar.h" +#include "arch/northstar/northstar.h" #include "lib/core/bytes.h" #include "lib/decoders/decoders.pb.h" #include "fmt/format.h" diff --git a/arch/northstar/encoder.cc b/arch/northstar/encoder.cc index 214c0f3d..6ce3daf6 100644 --- a/arch/northstar/encoder.cc +++ b/arch/northstar/encoder.cc @@ -1,5 +1,5 @@ #include "lib/core/globals.h" -#include "northstar.h" +#include "arch/northstar/northstar.h" #include "lib/data/sector.h" #include "lib/core/bytes.h" #include "lib/decoders/decoders.h" diff --git a/arch/rolandd20/decoder.cc b/arch/rolandd20/decoder.cc index a009d66c..6908ec53 100644 --- a/arch/rolandd20/decoder.cc +++ b/arch/rolandd20/decoder.cc @@ -6,7 +6,7 @@ #include "lib/data/fluxpattern.h" #include "lib/data/sector.h" #include "lib/core/bytes.h" -#include "rolandd20.h" +#include "arch/rolandd20/rolandd20.h" #include /* Sector header record: diff --git a/arch/smaky6/decoder.cc b/arch/smaky6/decoder.cc index 1c19efb7..e38898b1 100644 --- a/arch/smaky6/decoder.cc +++ b/arch/smaky6/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "smaky6.h" +#include "arch/smaky6/smaky6.h" #include "lib/core/bytes.h" #include "lib/core/crc.h" #include "fmt/format.h" diff --git a/arch/tids990/decoder.cc b/arch/tids990/decoder.cc index d161957f..22932b23 100644 --- a/arch/tids990/decoder.cc +++ b/arch/tids990/decoder.cc @@ -1,7 +1,7 @@ #include "lib/core/globals.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "arch/tids990/tids990.h" +#include "arch/tids990/tids990" #include "lib/core/crc.h" #include "lib/data/fluxmap.h" #include "lib/data/fluxmapreader.h" diff --git a/arch/tids990/encoder.cc b/arch/tids990/encoder.cc index 0b78b99d..03b316a8 100644 --- a/arch/tids990/encoder.cc +++ b/arch/tids990/encoder.cc @@ -1,7 +1,7 @@ #include "lib/core/globals.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "tids990.h" +#include "arch/tids990/tids990" #include "lib/core/crc.h" #include "lib/data/image.h" #include "arch/tids990/tids990.pb.h" diff --git a/arch/victor9k/decoder.cc b/arch/victor9k/decoder.cc index fe97b037..df943d5e 100644 --- a/arch/victor9k/decoder.cc +++ b/arch/victor9k/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "victor9k.h" +#include "arch/victor9k/victor9k.h" #include "lib/core/crc.h" #include "lib/core/bytes.h" #include "fmt/format.h" diff --git a/arch/victor9k/encoder.cc b/arch/victor9k/encoder.cc index 683494c5..3832a3eb 100644 --- a/arch/victor9k/encoder.cc +++ b/arch/victor9k/encoder.cc @@ -2,7 +2,7 @@ #include "lib/core/utils.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "victor9k.h" +#include "arch/victor9k/victor9k.h" #include "lib/core/crc.h" #include "lib/data/sector.h" #include "lib/data/image.h" diff --git a/arch/zilogmcz/decoder.cc b/arch/zilogmcz/decoder.cc index a29139dc..77421fa7 100644 --- a/arch/zilogmcz/decoder.cc +++ b/arch/zilogmcz/decoder.cc @@ -5,7 +5,7 @@ #include "protocol.h" #include "lib/decoders/decoders.h" #include "lib/data/sector.h" -#include "zilogmcz.h" +#include "arch/zilogmcz/zilogmcz.h" #include "lib/core/bytes.h" #include "lib/core/crc.h" #include "fmt/format.h" diff --git a/build.py b/build.py index c5a0b41f..3b543cfe 100644 --- a/build.py +++ b/build.py @@ -79,15 +79,15 @@ else: ins=["src+fluxengine"], deps=["scripts/encodedecodetest.sh"], commands=[ - "{deps[0]} " + "$[deps[0]] " + c[0] + " " + format - + " {ins[0]} '" + + " $[ins[0]] '" + c[1] + "' '" + c[2] - + "' $(dir {outs[0]}) > /dev/null" + + "' $(dir $[outs[0]]) > /dev/null" ], label="CORPUSTEST", ) diff --git a/build/ab.mk b/build/ab.mk index b272585a..fa622330 100644 --- a/build/ab.mk +++ b/build/ab.mk @@ -51,6 +51,8 @@ ifeq ($(OS), Windows_NT) endif EXT ?= +CWD=$(shell pwd) + ifeq ($(PROGRESSINFO),) # The first make invocation here has to have its output discarded or else it # produces spurious 'Leaving directory' messages... don't know why. diff --git a/build/ab.py b/build/ab.py index 5ae17c24..bc8fc21d 100644 --- a/build/ab.py +++ b/build/ab.py @@ -17,6 +17,9 @@ import inspect import string import sys import hashlib +import re +import ast +from collections import namedtuple verbose = False quiet = False @@ -26,6 +29,22 @@ unmaterialisedTargets = {} # dict, not set, to get consistent ordering materialisingStack = [] defaultGlobals = {} +RE_FORMAT_SPEC = re.compile( + r"(?:(?P[\s\S])?(?P[<>=^]))?" + r"(?P[- +])?" + r"(?Pz)?" + r"(?P#)?" + r"(?P0)?" + r"(?P\d+)?" + r"(?P[_,])?" + r"(?:(?P\.)(?P\d+))?" + r"(?P[bcdeEfFgGnosxX%])?" +) + +CommandFormatSpec = namedtuple( + "CommandFormatSpec", RE_FORMAT_SPEC.groupindex.keys() +) + sys.path += ["."] old_import = builtins.__import__ @@ -80,6 +99,29 @@ def error(message): raise ABException(message) +class BracketedFormatter(string.Formatter): + def parse(self, format_string): + while format_string: + left, *right = format_string.split("$[", 1) + if not right: + yield (left, None, None, None) + break + right = right[0] + + offset = len(right) + 1 + try: + ast.parse(right) + except SyntaxError as e: + if not str(e).startswith("unmatched ']'"): + raise e + offset = e.offset + + expr = right[0 : offset - 1] + format_string = right[offset:] + + yield (left if left else None, expr, None, None) + + def Rule(func): sig = inspect.signature(func) @@ -115,7 +157,7 @@ def Rule(func): t.callback = func t.traits.add(func.__name__) if "args" in kwargs: - t.args |= kwargs["args"] + t.args.update(kwargs["args"]) del kwargs["args"] if "traits" in kwargs: t.traits |= kwargs["traits"] @@ -166,7 +208,7 @@ class Target: return f"Target('{self.name}')" def templateexpand(selfi, s): - class Formatter(string.Formatter): + class Formatter(BracketedFormatter): def get_field(self, name, a1, a2): return ( eval(name, selfi.callback.__globals__, selfi.args), @@ -355,8 +397,16 @@ class TargetsMap: return output +def _removesuffix(self, suffix): + # suffix='' should not call self[:-0]. + if suffix and self.endswith(suffix): + return self[: -len(suffix)] + else: + return self[:] + + def loadbuildfile(filename): - filename = filename.replace("/", ".").removesuffix(".py") + filename = _removesuffix(filename.replace("/", "."), ".py") builtins.__import__(filename) @@ -406,8 +456,9 @@ def emit(*args, into=None): outputFp.write(s) -def emit_rule(name, ins, outs, cmds=[], label=None): - fins = filenamesof(ins) +def emit_rule(self, ins, outs, cmds=[], label=None): + name = self.name + fins = set(filenamesof(ins)) fouts = filenamesof(outs) nonobjs = [f for f in fouts if not f.startswith("$(OBJ)")] @@ -433,8 +484,23 @@ def emit_rule(name, ins, outs, cmds=[], label=None): if label: emit("\t$(hide)", "$(ECHO) $(PROGRESSINFO)", label, into=lines) + + sandbox = join(self.dir, "sandbox") + emit("\t$(hide)", f"rm -rf {sandbox}", into=lines) + emit( + "\t$(hide)", + f"$(PYTHON) build/_sandbox.py --link -s {sandbox}", + *fins, + into=lines, + ) for c in cmds: - emit("\t$(hide)", c, into=lines) + emit(f"\t$(hide) cd {sandbox} && (", c, ")", into=lines) + emit( + "\t$(hide)", + f"$(PYTHON) build/_sandbox.py --export -s {sandbox}", + *fouts, + into=lines, + ) else: assert len(cmds) == 0, "rules with no outputs cannot have commands" emit(name, ":", *fins, into=lines) @@ -479,10 +545,10 @@ def simplerule( cs += [self.templateexpand(c)] emit_rule( - name=self.name, + self=self, ins=ins + deps, outs=outs, - label=self.templateexpand("{label} {name}") if label else None, + label=self.templateexpand("$[label] $[name]") if label else None, cmds=cs, ) @@ -507,7 +573,7 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): cwd=self.cwd, ins=[srcs[0]], outs=[destf], - commands=["$(CP) %s %s" % (srcs[0], destf)], + commands=["$(CP) -H %s %s" % (srcs[0], destf)], label="", ) subrule.materialise() @@ -516,7 +582,7 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): replaces=self, ins=outs + deps, outs=["=sentinel"], - commands=["touch {outs[0]}"], + commands=["touch $[outs[0]]"], label="EXPORT", ) diff --git a/build/c.py b/build/c.py index 0045e634..658def28 100644 --- a/build/c.py +++ b/build/c.py @@ -20,6 +20,7 @@ endif """ ) + def _combine(list1, list2): r = list(list1) for i in list2: @@ -27,6 +28,7 @@ def _combine(list1, list2): r.append(i) return r + def _indirect(deps, name): r = [] for d in deps: @@ -61,7 +63,7 @@ def cfile( deps: Targets = None, cflags=[], suffix=".o", - commands=["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], + commands=["$(CC) -c -o $[outs[0]] $[ins[0]] $(CFLAGS) $[cflags]"], label="CC", ): cfileimpl(self, name, srcs, deps, suffix, commands, label, cflags) @@ -75,33 +77,49 @@ def cxxfile( deps: Targets = None, cflags=[], suffix=".o", - commands=["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], + commands=["$(CXX) -c -o $[outs[0]] $[ins[0]] $(CFLAGS) $[cflags]"], label="CXX", ): cfileimpl(self, name, srcs, deps, suffix, commands, label, cflags) +def _removeprefix(self, prefix): + if self.startswith(prefix): + return self[len(prefix) :] + else: + return self[:] + + +def _isSourceFile(f): + return ( + f.endswith(".c") + or f.endswith(".cc") + or f.endswith(".cpp") + or f.endswith(".S") + or f.endswith(".s") + or f.endswith(".m") + or f.endswith(".mm") + ) + + def findsources(name, srcs, deps, cflags, filerule, cwd): for f in filenamesof(srcs): - if f.endswith(".h") or f.endswith(".hh"): + if not _isSourceFile(f): cflags = cflags + [f"-I{dirname(f)}"] + deps = deps + [f] objs = [] for s in flatten(srcs): objs += [ filerule( - name=join(name, f.removeprefix("$(OBJ)/")), + name=join(name, _removeprefix(f, "$(OBJ)/")), srcs=[f], deps=deps, cflags=sorted(set(cflags)), cwd=cwd, ) for f in filenamesof([s]) - if f.endswith(".c") - or f.endswith(".cc") - or f.endswith(".cpp") - or f.endswith(".S") - or f.endswith(".s") + if _isSourceFile(f) ] if any(f.endswith(".o") for f in filenamesof([s])): objs += [s] @@ -140,7 +158,7 @@ def libraryimpl( len(s) == 1 ), "the target of a header must return exactly one file" - cs += ["$(CP) {ins[" + str(i) + "]} {outs[" + str(i) + "]}"] + cs += [f"$(CP) $[ins[{i}]] $[outs[{i}]]"] outs += ["=" + dest] i = i + 1 @@ -194,7 +212,7 @@ def clibrary( caller_ldflags=[], cflags=[], ldflags=[], - commands=["rm -f {outs[0]} && $(AR) cqs {outs[0]} {ins}"], + commands=["rm -f $[outs[0]] && $(AR) cqs $[outs[0]] $[ins]"], label="LIB", cfilerule=cfile, ): @@ -225,7 +243,7 @@ def cxxlibrary( caller_ldflags=[], cflags=[], ldflags=[], - commands=["rm -f {outs[0]} && $(AR) cqs {outs[0]} {ins}"], + commands=["rm -f $[outs[0]] && $(AR) cqs $[outs[0]] $[ins]"], label="CXXLIB", cxxfilerule=cxxfile, ): @@ -290,7 +308,7 @@ def cprogram( cflags=[], ldflags=[], commands=[ - "$(CC) -o {outs[0]} $(STARTGROUP) {ins} {ldflags} $(LDFLAGS) $(ENDGROUP)" + "$(CC) -o $[outs[0]] $(STARTGROUP) $[ins] $[ldflags] $(LDFLAGS) $(ENDGROUP)" ], label="CLINK", cfilerule=cfile, @@ -317,7 +335,7 @@ def cxxprogram( cflags=[], ldflags=[], commands=[ - "$(CXX) -o {outs[0]} $(STARTGROUP) {ins} {ldflags} $(LDFLAGS) $(ENDGROUP)" + "$(CXX) -o $[outs[0]] $(STARTGROUP) $[ins] $[ldflags] $(LDFLAGS) $(ENDGROUP)" ], label="CXXLINK", cxxfilerule=cxxfile, diff --git a/build/pkg.py b/build/pkg.py index c8deb1fb..d7f0376a 100644 --- a/build/pkg.py +++ b/build/pkg.py @@ -50,7 +50,7 @@ def _package(self, name, package, fallback, pkgconfig): assert ( fallback - ), f"Required package '{package}' not installed when materialising target '{name}'" + ), f"Required package '{package}' not installed when materialising target '$[name]'" if "cheader_deps" in fallback.args: self.args["cheader_deps"] = fallback.args["cheader_deps"] diff --git a/build/protobuf.py b/build/protobuf.py index d5e02cb3..59ba2272 100644 --- a/build/protobuf.py +++ b/build/protobuf.py @@ -31,7 +31,7 @@ def proto(self, name, srcs: Targets = [], deps: Targets = []): ] ) - dirs = sorted({"{dir}/" + dirname(f) for f in filenamesof(srcs)}) + dirs = sorted({"$[dir]/" + dirname(f) for f in filenamesof(srcs)}) simplerule( replaces=self, ins=srcs, @@ -39,9 +39,9 @@ def proto(self, name, srcs: Targets = [], deps: Targets = []): deps=protodeps, commands=( ["mkdir -p " + (" ".join(dirs))] - + [f"$(CP) {f} {{dir}}/{f}" for f in filenamesof(srcs)] + + [f"$(CP) {f} $[dir]/{f}" for f in filenamesof(srcs)] + [ - "cd {dir} && " + "cd $[dir] && " + ( " ".join( [ @@ -55,7 +55,7 @@ def proto(self, name, srcs: Targets = [], deps: Targets = []): if descriptorlist else [] ) - + ["{ins}"] + + ["$[ins]"] ) ) ] @@ -96,7 +96,7 @@ def protocc(self, name, srcs: Targets = [], deps: Targets = []): outs=outs, deps=protodeps, commands=[ - "cd {dir} && " + "cd $[dir] && " + ( " ".join( [ @@ -146,8 +146,8 @@ def protojava(self, name, srcs: Targets = [], deps: Targets = []): outs=[f"={self.localname}.srcjar"], deps=srcs + deps, commands=[ - "mkdir -p {dir}/srcs", - "cd {dir} && " + "mkdir -p $[dir]/srcs", + "cd $[dir]/srcs && " + ( " ".join( [ @@ -159,7 +159,7 @@ def protojava(self, name, srcs: Targets = [], deps: Targets = []): + protos ) ), - "$(JAR) cf {outs[0]} -C {dir}/srcs .", + "$(JAR) cf $[outs[0]] -C $[dir]/srcs .", ], traits={"srcjar"}, label="PROTOJAVA", diff --git a/build/utils.py b/build/utils.py index 4d519886..906cfc51 100644 --- a/build/utils.py +++ b/build/utils.py @@ -58,7 +58,7 @@ def objectify(self, name, src: Target, symbol): replaces=self, ins=["build/_objectify.py", src], outs=[f"={basename(filenameof(src))}.h"], - commands=["$(PYTHON) {ins[0]} {ins[1]} " + symbol + " > {outs}"], + commands=["$(PYTHON) $[ins[0]] $[ins[1]] " + symbol + " > $[outs]"], label="OBJECTIFY", ) @@ -78,7 +78,7 @@ def test( replaces=self, ins=[command], outs=["=sentinel"], - commands=["{ins[0]}", "touch {outs}"], + commands=["$[ins[0]]", "touch $[outs]"], deps=deps, label=label, ) @@ -87,7 +87,7 @@ def test( replaces=self, ins=ins, outs=["=sentinel"], - commands=commands + ["touch {outs}"], + commands=commands + ["touch $[outs]"], deps=deps, label=label, ) diff --git a/build/zip.py b/build/zip.py index 421a5a10..2b631c69 100644 --- a/build/zip.py +++ b/build/zip.py @@ -3,14 +3,6 @@ from build.ab import ( simplerule, TargetsMap, filenameof, - emit, -) - -emit( - """ -ZIP ?= zip -ZIPNOTE ?= zipnote -""" ) @@ -18,20 +10,18 @@ ZIPNOTE ?= zipnote def zip( self, name, flags="", items: TargetsMap = {}, extension="zip", label="ZIP" ): - cs = ["rm -f {outs[0]}"] + cs = ["$(PYTHON) build/_zip.py -z $[outs]"] ins = [] for k, v in items.items(): - cs += [ - "cat %s | $(ZIP) -q %s {outs[0]} -" % (filenameof(v), flags), - "printf '@ -\\n@=%s\\n' | $(ZIPNOTE) -w {outs[0]}" % k, - ] + cs += [f"-f {k} {filenameof(v)}"] ins += [v] simplerule( replaces=self, ins=ins, + deps=["build/_zip.py"], outs=[f"={self.localname}." + extension], - commands=cs, + commands=[" ".join(cs)], label=label, ) diff --git a/dep/hfsutils/build.py b/dep/hfsutils/build.py index 5df683f7..85e2d689 100644 --- a/dep/hfsutils/build.py +++ b/dep/hfsutils/build.py @@ -4,17 +4,28 @@ clibrary( name="hfsutils", srcs=[ "./libhfs/block.c", + "./libhfs/block.h", "./libhfs/btree.c", + "./libhfs/btree.h", "./libhfs/data.c", + "./libhfs/data.h", "./libhfs/file.c", + "./libhfs/file.h", "./libhfs/hfs.c", + "./libhfs/hfs.h", "./libhfs/low.c", + "./libhfs/low.h", "./libhfs/medium.c", + "./libhfs/medium.h", "./libhfs/memcmp.c", "./libhfs/node.c", + "./libhfs/node.h", "./libhfs/record.c", + "./libhfs/record.h", "./libhfs/version.c", + "./libhfs/version.h", "./libhfs/volume.c", + "./libhfs/volume.h", ], hdrs={ "apple.h": "./libhfs/apple.h", diff --git a/extras/build.py b/extras/build.py index bad8b1cb..b70321a8 100644 --- a/extras/build.py +++ b/extras/build.py @@ -19,8 +19,8 @@ simplerule( ins=["./icon.png"], outs=["=fluxengine.iconset"], commands=[ - "mkdir -p {outs[0]}", - "sips -z 64 64 {ins[0]} --out {outs[0]}/icon_32x32@2x.png > /dev/null", + "mkdir -p $[outs[0]]", + "sips -z 64 64 $[ins[0]] --out $[outs[0]]/icon_32x32@2x.png > /dev/null", ], label="ICONSET", ) @@ -29,7 +29,7 @@ simplerule( name="fluxengine_icns", ins=[".+fluxengine_iconset"], outs=["=fluxengine.icns"], - commands=["iconutil -c icns -o {outs[0]} {ins[0]}"], + commands=["iconutil -c icns -o $[outs[0]] $[ins[0]]"], label="ICONUTIL", ) @@ -37,6 +37,6 @@ simplerule( name="fluxengine_ico", ins=["./icon.png"], outs=["=fluxengine.ico"], - commands=["png2ico {outs[0]} {ins[0]}"], + commands=["png2ico $[outs[0]] $[ins[0]]"], label="MAKEICON", ) diff --git a/lib/external/greaseweazle.cc b/lib/external/greaseweazle.cc index c7969ae4..40af5558 100644 --- a/lib/external/greaseweazle.cc +++ b/lib/external/greaseweazle.cc @@ -1,7 +1,7 @@ #include "lib/core/globals.h" #include "protocol.h" #include "lib/core/bytes.h" -#include "greaseweazle.h" +#include "lib/external/greaseweazle.h" Bytes fluxEngineToGreaseweazle(const Bytes& fldata, nanoseconds_t clock) { diff --git a/lib/usb/applesauceusb.cc b/lib/usb/applesauceusb.cc index edb1b9a4..c5868081 100644 --- a/lib/usb/applesauceusb.cc +++ b/lib/usb/applesauceusb.cc @@ -4,8 +4,8 @@ #include "lib/core/bytes.h" #include "lib/usb/usb.pb.h" #include "lib/core/utils.h" -#include "serial.h" -#include "usb.h" +#include "lib/usb/serial.h" +#include "lib/usb/usb.h" #include "lib/data/fluxmapreader.h" #include diff --git a/lib/usb/build.py b/lib/usb/build.py index ffb6244b..8e2eab55 100644 --- a/lib/usb/build.py +++ b/lib/usb/build.py @@ -16,6 +16,6 @@ cxxlibrary( "./usb.cc", "./usbfinder.cc", ], - hdrs={"lib/usb/usb.h": "./usb.h", "lib/usb/usbfinder.h": "./usbfinder.h"}, + hdrs={"lib/usb/usb.h": "./usb.h", "lib/usb/usbfinder.h": "./usbfinder.h", "lib/usb/serial.h": "./serial.h"}, deps=["lib/core", "lib/config", "lib/external", "dep/libusbp", "+protocol"], ) diff --git a/lib/usb/fluxengineusb.cc b/lib/usb/fluxengineusb.cc index 7000d7ab..dde8ed07 100644 --- a/lib/usb/fluxengineusb.cc +++ b/lib/usb/fluxengineusb.cc @@ -1,5 +1,5 @@ #include "lib/core/globals.h" -#include "usb.h" +#include "lib/usb/usb.h" #include "protocol.h" #include "lib/data/fluxmap.h" #include "lib/core/bytes.h" diff --git a/lib/usb/greaseweazleusb.cc b/lib/usb/greaseweazleusb.cc index a0849b60..2f6817b3 100644 --- a/lib/usb/greaseweazleusb.cc +++ b/lib/usb/greaseweazleusb.cc @@ -4,8 +4,8 @@ #include "lib/core/bytes.h" #include "lib/usb/usb.pb.h" #include "lib/external/greaseweazle.h" -#include "serial.h" -#include "usb.h" +#include "lib/usb/serial.h" +#include "lib/usb/usb.h" #include static const char* gw_error(int e) diff --git a/lib/usb/serial.cc b/lib/usb/serial.cc index 00d781ba..7f667681 100644 --- a/lib/usb/serial.cc +++ b/lib/usb/serial.cc @@ -1,9 +1,9 @@ #include "lib/core/globals.h" -#include "usb.h" +#include "lib/usb/usb.h" #include "protocol.h" #include "lib/data/fluxmap.h" #include "lib/core/bytes.h" -#include "serial.h" +#include "lib/usb/serial.h" #include #include #include diff --git a/lib/usb/usb.cc b/lib/usb/usb.cc index e35ca604..e53af370 100644 --- a/lib/usb/usb.cc +++ b/lib/usb/usb.cc @@ -1,14 +1,14 @@ #include "lib/core/globals.h" #include "lib/config/config.h" #include "lib/config/flags.h" -#include "usb.h" +#include "lib/usb/usb.h" #include "libusbp_config.h" #include "libusbp.hpp" #include "protocol.h" #include "lib/data/fluxmap.h" #include "lib/core/bytes.h" #include "lib/config/proto.h" -#include "usbfinder.h" +#include "lib/usb/usbfinder.h" #include "lib/core/logger.h" #include "lib/external/applesauce.h" #include "lib/external/greaseweazle.h" diff --git a/lib/usb/usbfinder.cc b/lib/usb/usbfinder.cc index 3318d109..4453ccb4 100644 --- a/lib/usb/usbfinder.cc +++ b/lib/usb/usbfinder.cc @@ -1,8 +1,8 @@ #include "lib/core/globals.h" #include "lib/config/flags.h" -#include "usb.h" +#include "lib/usb/usb.h" #include "lib/core/bytes.h" -#include "usbfinder.h" +#include "lib/usb/usbfinder.h" #include "lib/external/applesauce.h" #include "lib/external/greaseweazle.h" #include "protocol.h" diff --git a/lib/vfs/vfs.cc b/lib/vfs/vfs.cc index 50340539..a3efe608 100644 --- a/lib/vfs/vfs.cc +++ b/lib/vfs/vfs.cc @@ -1,6 +1,6 @@ #include "lib/core/globals.h" #include "lib/config/config.h" -#include "vfs.h" +#include "lib/vfs/vfs.h" #include "lib/config/proto.h" #include "lib/config/layout.pb.h" #include "lib/data/layout.h" diff --git a/scripts/build.py b/scripts/build.py index 70a10d7e..2913e43b 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -30,7 +30,7 @@ def protoencode_single(self, name, srcs: Targets, proto, symbol): ins=srcs, outs=[f"={name}.cc"], deps=[r], - commands=["{deps[0]} {ins} {outs} " + symbol], + commands=["$[deps[0]] $[ins] $[outs] " + symbol], label="PROTOENCODE", ) @@ -51,7 +51,7 @@ def protoencode(self, name, proto, srcs: TargetsMap, symbol): replaces=self, ins=encoded, outs=[f"={name}.cc"], - commands=["cat {ins} > {outs}"], + commands=["cat $[ins] > $[outs]"], label="CONCAT", ) diff --git a/src/build.py b/src/build.py index 68bd0362..e9cedf7b 100644 --- a/src/build.py +++ b/src/build.py @@ -4,6 +4,7 @@ cxxprogram( name="fluxengine", srcs=[ "./fluxengine.cc", + "./fluxengine.h", "./fe-analysedriveresponse.cc", "./fe-analyselayout.cc", "./fe-format.cc", @@ -27,6 +28,7 @@ cxxprogram( "./fe-testvoltages.cc", "./fe-write.cc", "./fileutils.cc", + "./fileutils.h", ], cflags=["-I."], deps=[ diff --git a/src/formats/build.py b/src/formats/build.py index c1f67a14..c1602730 100644 --- a/src/formats/build.py +++ b/src/formats/build.py @@ -47,7 +47,7 @@ simplerule( deps=["scripts/mktable.sh"], outs=["=table.cc"], commands=[ - "sh scripts/mktable.sh formats " + (" ".join(formats)) + " > {outs}" + "sh scripts/mktable.sh formats " + (" ".join(formats)) + " > $[outs]" ], label="MKTABLE", ) @@ -72,7 +72,7 @@ export( name=f"{f}_doc", ins=["scripts+mkdoc"], outs=[f"=disk-{f}.md"], - commands=["{ins[0]} " + f + " | tr -d '\\r' > {outs[0]}"], + commands=["$[ins[0]] " + f + " | tr -d '\\r' > $[outs[0]]"], label="MKDOC", ) for f in formats diff --git a/src/gui/build.py b/src/gui/build.py index e64434c3..d9e0f963 100644 --- a/src/gui/build.py +++ b/src/gui/build.py @@ -1,5 +1,6 @@ from build.ab import emit, simplerule from build.c import cxxprogram +from glob import glob import config emit( @@ -23,35 +24,15 @@ if config.windows: ins=["./windres.rc"], outs=["=rc.o"], deps=["./manifest.xml", "extras+fluxengine_ico"], - commands=["$(WINDRES) {ins[0]} {outs[0]}"], + commands=["$(WINDRES) $[ins[0]] $[outs[0]]"], label="WINDRES", ) ] cxxprogram( name="gui", - srcs=[ - "./browserpanel.cc", - "./context.cc", - "./context.h", - "./customstatusbar.cc", - "./explorerpanel.cc", - "./filesystemmodel.cc", - "./fileviewerwindow.cc", - "./fluxviewercontrol.cc", - "./fluxviewerwindow.cc", - "./histogramviewer.cc", - "./iconbutton.cc", - "./idlepanel.cc", - "./imagerpanel.cc", - "./jobqueue.cc", - "./main.cc", - "./mainwindow.cc", - "./texteditorwindow.cc", - "./textviewerwindow.cc", - "./visualisationcontrol.cc", - "./layout.cpp", - ] + srcs=glob("*.c", root_dir="src/gui") + + glob("*.h", root_dir="src/gui") + extrasrcs, cflags=["$(WX_CFLAGS)"], ldflags=["$(WX_LDFLAGS)"], @@ -82,7 +63,7 @@ if config.osx: ins=[".+fluxengine_app"], outs=["=FluxEngine.pkg"], commands=[ - "pkgbuild --quiet --install-location /Applications --component {ins[0]} {outs[0]}" + "pkgbuild --quiet --install-location /Applications --component $[ins[0]] $[outs[0]]" ], label="PKGBUILD", ) @@ -96,21 +77,21 @@ if config.osx: ], outs=["=FluxEngine.app"], commands=[ - "rm -rf {outs[0]}", - "cp -a {ins[2]} {outs[0]}", - "touch {outs[0]}", - "cp {ins[0]} {outs[0]}/Contents/MacOS/fluxengine-gui", - "mkdir -p {outs[0]}/Contents/Resources", - "cp {ins[1]} {outs[0]}/Contents/Resources/FluxEngine.icns", - "dylibbundler -of -x {outs[0]}/Contents/MacOS/fluxengine-gui -b -d {outs[0]}/Contents/libs -cd > /dev/null", - "cp $$(brew --prefix wxwidgets)/README.md {outs[0]}/Contents/libs/wxWidgets.md", - "cp $$(brew --prefix protobuf)/LICENSE {outs[0]}/Contents/libs/protobuf.txt", - "cp $$(brew --prefix fmt)/LICENSE* {outs[0]}/Contents/libs/fmt.rst", - "cp $$(brew --prefix libpng)/LICENSE {outs[0]}/Contents/libs/libpng.txt", - "cp $$(brew --prefix libjpeg)/README {outs[0]}/Contents/libs/libjpeg.txt", - "cp $$(brew --prefix abseil)/LICENSE {outs[0]}/Contents/libs/abseil.txt", - "cp $$(brew --prefix libtiff)/LICENSE.md {outs[0]}/Contents/libs/libtiff.txt", - "cp $$(brew --prefix zstd)/LICENSE {outs[0]}/Contents/libs/zstd.txt", + "rm -rf $[outs[0]]", + "cp -a $[ins[2]] $[outs[0]]", + "touch $[outs[0]]", + "cp $[ins[0]] $[outs[0]]/Contents/MacOS/fluxengine-gui", + "mkdir -p $[outs[0]]/Contents/Resources", + "cp $[ins[1]] $[outs[0]]/Contents/Resources/FluxEngine.icns", + "dylibbundler -of -x $[outs[0]]/Contents/MacOS/fluxengine-gui -b -d $[outs[0]]/Contents/libs -cd > /dev/null", + "cp $$(brew --prefix wxwidgets)/README.md $[outs[0]]/Contents/libs/wxWidgets.md", + "cp $$(brew --prefix protobuf)/LICENSE $[outs[0]]/Contents/libs/protobuf.txt", + "cp $$(brew --prefix fmt)/LICENSE* $[outs[0]]/Contents/libs/fmt.rst", + "cp $$(brew --prefix libpng)/LICENSE $[outs[0]]/Contents/libs/libpng.txt", + "cp $$(brew --prefix libjpeg)/README $[outs[0]]/Contents/libs/libjpeg.txt", + "cp $$(brew --prefix abseil)/LICENSE $[outs[0]]/Contents/libs/abseil.txt", + "cp $$(brew --prefix libtiff)/LICENSE.md $[outs[0]]/Contents/libs/libtiff.txt", + "cp $$(brew --prefix zstd)/LICENSE $[outs[0]]/Contents/libs/zstd.txt", ], label="MKAPP", ) diff --git a/src/gui/drivetypes/build.py b/src/gui/drivetypes/build.py index c5f5d645..0bd1c35e 100644 --- a/src/gui/drivetypes/build.py +++ b/src/gui/drivetypes/build.py @@ -16,7 +16,7 @@ simplerule( commands=[ "sh scripts/mktable.sh drivetypes " + (" ".join(drivetypes)) - + " > {outs}" + + " > $[outs]" ], label="MKTABLE", ) diff --git a/tests/build.py b/tests/build.py index acd6bab5..923a32ae 100644 --- a/tests/build.py +++ b/tests/build.py @@ -83,7 +83,7 @@ export( name=f"{n}_test", command=cxxprogram( name=f"{n}_test_exe", - srcs=[f"./{n}.cc"], + srcs=[f"./{n}.cc", "./tests.h"], deps=[ "lib/external+fl2_proto_lib", "+fmt_lib",