Make build with the new ab --- but the tests fail.

This commit is contained in:
David Given
2025-03-17 22:33:54 +01:00
parent 0f763fe06b
commit 15a69f6dcb
57 changed files with 220 additions and 148 deletions

View File

@@ -1,6 +1,6 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "aeslanier.h" #include "arch/aeslanier/aeslanier.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/fluxmap.h" #include "lib/data/fluxmap.h"
#include "lib/data/fluxmapreader.h" #include "lib/data/fluxmapreader.h"

View File

@@ -1,6 +1,6 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "agat.h" #include "arch/agat/agat.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -1,6 +1,6 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "agat.h" #include "arch/agat/agat.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/fluxmap.h" #include "lib/data/fluxmap.h"
#include "lib/data/fluxmapreader.h" #include "lib/data/fluxmapreader.h"

View File

@@ -2,7 +2,7 @@
#include "lib/core/utils.h" #include "lib/core/utils.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "agat.h" #include "arch/agat/agat.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/image.h" #include "lib/data/image.h"
#include "lib/data/layout.h" #include "lib/data/layout.h"

View File

@@ -1,6 +1,6 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "amiga.h" #include "arch/amiga/amiga.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "amiga.h" #include "arch/amiga/amiga.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"
#include "lib/decoders/decoders.pb.h" #include "lib/decoders/decoders.pb.h"

View File

@@ -2,7 +2,7 @@
#include "lib/core/utils.h" #include "lib/core/utils.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "amiga.h" #include "arch/amiga/amiga.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/image.h" #include "lib/data/image.h"
#include "arch/amiga/amiga.pb.h" #include "arch/amiga/amiga.pb.h"

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "apple2.h" #include "arch/apple2/apple2.h"
#include "arch/apple2/apple2.pb.h" #include "arch/apple2/apple2.pb.h"
#include "lib/decoders/decoders.pb.h" #include "lib/decoders/decoders.pb.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"

View File

@@ -18,7 +18,7 @@
#include "arch/rolandd20/rolandd20.h" #include "arch/rolandd20/rolandd20.h"
#include "arch/smaky6/smaky6.h" #include "arch/smaky6/smaky6.h"
#include "arch/tartu/tartu.h" #include "arch/tartu/tartu.h"
#include "arch/tids990/tids990.h" #include "arch/tids990/tids990"
#include "arch/victor9k/victor9k.h" #include "arch/victor9k/victor9k.h"
#include "arch/zilogmcz/zilogmcz.h" #include "arch/zilogmcz/zilogmcz.h"
#include "arch/arch.h" #include "arch/arch.h"

View File

@@ -4,7 +4,7 @@
#include "lib/data/fluxpattern.h" #include "lib/data/fluxpattern.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "brother.h" #include "arch/brother/brother.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"

View File

@@ -2,7 +2,7 @@
#include "lib/core/utils.h" #include "lib/core/utils.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "brother.h" #include "arch/brother/brother.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/image.h" #include "lib/data/image.h"
#include "arch/brother/brother.pb.h" #include "arch/brother/brother.pb.h"

View File

@@ -46,6 +46,7 @@ cxxlibrary(
"./apple2/encoder.cc", "./apple2/encoder.cc",
"./brother/decoder.cc", "./brother/decoder.cc",
"./brother/encoder.cc", "./brother/encoder.cc",
"./brother/header_gcr.h",
"./c64/c64.cc", "./c64/c64.cc",
"./c64/decoder.cc", "./c64/decoder.cc",
"./c64/encoder.cc", "./c64/encoder.cc",
@@ -55,6 +56,7 @@ cxxlibrary(
"./ibm/encoder.cc", "./ibm/encoder.cc",
"./macintosh/decoder.cc", "./macintosh/decoder.cc",
"./macintosh/encoder.cc", "./macintosh/encoder.cc",
"./macintosh/data_gcr.h",
"./micropolis/decoder.cc", "./micropolis/decoder.cc",
"./micropolis/encoder.cc", "./micropolis/encoder.cc",
"./mx/decoder.cc", "./mx/decoder.cc",
@@ -76,7 +78,7 @@ cxxlibrary(
"arch/apple2/apple2.h": "./apple2/apple2.h", "arch/apple2/apple2.h": "./apple2/apple2.h",
"arch/amiga/amiga.h": "./amiga/amiga.h", "arch/amiga/amiga.h": "./amiga/amiga.h",
"arch/smaky6/smaky6.h": "./smaky6/smaky6.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/zilogmcz/zilogmcz.h": "./zilogmcz/zilogmcz.h",
"arch/amiga/amiga.h": "./amiga/amiga.h", "arch/amiga/amiga.h": "./amiga/amiga.h",
"arch/f85/data_gcr.h": "./f85/data_gcr.h", "arch/f85/data_gcr.h": "./f85/data_gcr.h",

View File

@@ -1,5 +1,5 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "c64.h" #include "arch/c64/c64.h"
/* /*
* Track Sectors/track # Sectors Storage in Bytes Clock rate * Track Sectors/track # Sectors Storage in Bytes Clock rate

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "c64.h" #include "arch/c64/c64.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -2,7 +2,7 @@
#include "lib/core/utils.h" #include "lib/core/utils.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "c64.h" #include "arch/c64/c64.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "lib/data/image.h" #include "lib/data/image.h"

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "f85.h" #include "arch/f85/f85.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "fb100.h" #include "arch/fb100/fb100.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/decoders/rawbits.h" #include "lib/decoders/rawbits.h"

View File

@@ -1,6 +1,6 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "ibm.h" #include "arch/ibm/ibm.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/fluxmap.h" #include "lib/data/fluxmap.h"
#include "lib/data/fluxmapreader.h" #include "lib/data/fluxmapreader.h"

View File

@@ -2,7 +2,7 @@
#include "lib/config/config.h" #include "lib/config/config.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "ibm.h" #include "arch/ibm/ibm.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/image.h" #include "lib/data/image.h"
#include "arch/ibm/ibm.pb.h" #include "arch/ibm/ibm.pb.h"

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "macintosh.h" #include "arch/macintosh/macintosh.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"
#include <string.h> #include <string.h>

View File

@@ -2,7 +2,7 @@
#include "lib/core/utils.h" #include "lib/core/utils.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "macintosh.h" #include "arch/macintosh/macintosh.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/image.h" #include "lib/data/image.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -4,7 +4,7 @@
#include "lib/data/fluxpattern.h" #include "lib/data/fluxpattern.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "micropolis.h" #include "arch/micropolis/micropolis.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"
#include "lib/decoders/decoders.pb.h" #include "lib/decoders/decoders.pb.h"

View File

@@ -1,5 +1,5 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "micropolis.h" #include "arch/micropolis/micropolis.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"

View File

@@ -17,7 +17,7 @@
#include "lib/data/fluxpattern.h" #include "lib/data/fluxpattern.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "northstar.h" #include "arch/northstar/northstar.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/decoders/decoders.pb.h" #include "lib/decoders/decoders.pb.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -1,5 +1,5 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "northstar.h" #include "arch/northstar/northstar.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"

View File

@@ -6,7 +6,7 @@
#include "lib/data/fluxpattern.h" #include "lib/data/fluxpattern.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "rolandd20.h" #include "arch/rolandd20/rolandd20.h"
#include <string.h> #include <string.h>
/* Sector header record: /* Sector header record:

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "smaky6.h" #include "arch/smaky6/smaky6.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -1,7 +1,7 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "arch/tids990/tids990.h" #include "arch/tids990/tids990"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/fluxmap.h" #include "lib/data/fluxmap.h"
#include "lib/data/fluxmapreader.h" #include "lib/data/fluxmapreader.h"

View File

@@ -1,7 +1,7 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "tids990.h" #include "arch/tids990/tids990"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/image.h" #include "lib/data/image.h"
#include "arch/tids990/tids990.pb.h" #include "arch/tids990/tids990.pb.h"

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "victor9k.h" #include "arch/victor9k/victor9k.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -2,7 +2,7 @@
#include "lib/core/utils.h" #include "lib/core/utils.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/encoders/encoders.h" #include "lib/encoders/encoders.h"
#include "victor9k.h" #include "arch/victor9k/victor9k.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "lib/data/image.h" #include "lib/data/image.h"

View File

@@ -5,7 +5,7 @@
#include "protocol.h" #include "protocol.h"
#include "lib/decoders/decoders.h" #include "lib/decoders/decoders.h"
#include "lib/data/sector.h" #include "lib/data/sector.h"
#include "zilogmcz.h" #include "arch/zilogmcz/zilogmcz.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/core/crc.h" #include "lib/core/crc.h"
#include "fmt/format.h" #include "fmt/format.h"

View File

@@ -79,15 +79,15 @@ else:
ins=["src+fluxengine"], ins=["src+fluxengine"],
deps=["scripts/encodedecodetest.sh"], deps=["scripts/encodedecodetest.sh"],
commands=[ commands=[
"{deps[0]} " "$[deps[0]] "
+ c[0] + c[0]
+ " " + " "
+ format + format
+ " {ins[0]} '" + " $[ins[0]] '"
+ c[1] + c[1]
+ "' '" + "' '"
+ c[2] + c[2]
+ "' $(dir {outs[0]}) > /dev/null" + "' $(dir $[outs[0]]) > /dev/null"
], ],
label="CORPUSTEST", label="CORPUSTEST",
) )

View File

@@ -51,6 +51,8 @@ ifeq ($(OS), Windows_NT)
endif endif
EXT ?= EXT ?=
CWD=$(shell pwd)
ifeq ($(PROGRESSINFO),) ifeq ($(PROGRESSINFO),)
# The first make invocation here has to have its output discarded or else it # The first make invocation here has to have its output discarded or else it
# produces spurious 'Leaving directory' messages... don't know why. # produces spurious 'Leaving directory' messages... don't know why.

View File

@@ -17,6 +17,9 @@ import inspect
import string import string
import sys import sys
import hashlib import hashlib
import re
import ast
from collections import namedtuple
verbose = False verbose = False
quiet = False quiet = False
@@ -26,6 +29,22 @@ unmaterialisedTargets = {} # dict, not set, to get consistent ordering
materialisingStack = [] materialisingStack = []
defaultGlobals = {} defaultGlobals = {}
RE_FORMAT_SPEC = re.compile(
r"(?:(?P<fill>[\s\S])?(?P<align>[<>=^]))?"
r"(?P<sign>[- +])?"
r"(?P<pos_zero>z)?"
r"(?P<alt>#)?"
r"(?P<zero_padding>0)?"
r"(?P<width_str>\d+)?"
r"(?P<grouping>[_,])?"
r"(?:(?P<decimal>\.)(?P<precision_str>\d+))?"
r"(?P<type>[bcdeEfFgGnosxX%])?"
)
CommandFormatSpec = namedtuple(
"CommandFormatSpec", RE_FORMAT_SPEC.groupindex.keys()
)
sys.path += ["."] sys.path += ["."]
old_import = builtins.__import__ old_import = builtins.__import__
@@ -80,6 +99,29 @@ def error(message):
raise ABException(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): def Rule(func):
sig = inspect.signature(func) sig = inspect.signature(func)
@@ -115,7 +157,7 @@ def Rule(func):
t.callback = func t.callback = func
t.traits.add(func.__name__) t.traits.add(func.__name__)
if "args" in kwargs: if "args" in kwargs:
t.args |= kwargs["args"] t.args.update(kwargs["args"])
del kwargs["args"] del kwargs["args"]
if "traits" in kwargs: if "traits" in kwargs:
t.traits |= kwargs["traits"] t.traits |= kwargs["traits"]
@@ -166,7 +208,7 @@ class Target:
return f"Target('{self.name}')" return f"Target('{self.name}')"
def templateexpand(selfi, s): def templateexpand(selfi, s):
class Formatter(string.Formatter): class Formatter(BracketedFormatter):
def get_field(self, name, a1, a2): def get_field(self, name, a1, a2):
return ( return (
eval(name, selfi.callback.__globals__, selfi.args), eval(name, selfi.callback.__globals__, selfi.args),
@@ -355,8 +397,16 @@ class TargetsMap:
return output 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): def loadbuildfile(filename):
filename = filename.replace("/", ".").removesuffix(".py") filename = _removesuffix(filename.replace("/", "."), ".py")
builtins.__import__(filename) builtins.__import__(filename)
@@ -406,8 +456,9 @@ def emit(*args, into=None):
outputFp.write(s) outputFp.write(s)
def emit_rule(name, ins, outs, cmds=[], label=None): def emit_rule(self, ins, outs, cmds=[], label=None):
fins = filenamesof(ins) name = self.name
fins = set(filenamesof(ins))
fouts = filenamesof(outs) fouts = filenamesof(outs)
nonobjs = [f for f in fouts if not f.startswith("$(OBJ)")] 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: if label:
emit("\t$(hide)", "$(ECHO) $(PROGRESSINFO)", label, into=lines) 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: 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: else:
assert len(cmds) == 0, "rules with no outputs cannot have commands" assert len(cmds) == 0, "rules with no outputs cannot have commands"
emit(name, ":", *fins, into=lines) emit(name, ":", *fins, into=lines)
@@ -479,10 +545,10 @@ def simplerule(
cs += [self.templateexpand(c)] cs += [self.templateexpand(c)]
emit_rule( emit_rule(
name=self.name, self=self,
ins=ins + deps, ins=ins + deps,
outs=outs, outs=outs,
label=self.templateexpand("{label} {name}") if label else None, label=self.templateexpand("$[label] $[name]") if label else None,
cmds=cs, cmds=cs,
) )
@@ -507,7 +573,7 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []):
cwd=self.cwd, cwd=self.cwd,
ins=[srcs[0]], ins=[srcs[0]],
outs=[destf], outs=[destf],
commands=["$(CP) %s %s" % (srcs[0], destf)], commands=["$(CP) -H %s %s" % (srcs[0], destf)],
label="", label="",
) )
subrule.materialise() subrule.materialise()
@@ -516,7 +582,7 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []):
replaces=self, replaces=self,
ins=outs + deps, ins=outs + deps,
outs=["=sentinel"], outs=["=sentinel"],
commands=["touch {outs[0]}"], commands=["touch $[outs[0]]"],
label="EXPORT", label="EXPORT",
) )

View File

@@ -20,6 +20,7 @@ endif
""" """
) )
def _combine(list1, list2): def _combine(list1, list2):
r = list(list1) r = list(list1)
for i in list2: for i in list2:
@@ -27,6 +28,7 @@ def _combine(list1, list2):
r.append(i) r.append(i)
return r return r
def _indirect(deps, name): def _indirect(deps, name):
r = [] r = []
for d in deps: for d in deps:
@@ -61,7 +63,7 @@ def cfile(
deps: Targets = None, deps: Targets = None,
cflags=[], cflags=[],
suffix=".o", suffix=".o",
commands=["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], commands=["$(CC) -c -o $[outs[0]] $[ins[0]] $(CFLAGS) $[cflags]"],
label="CC", label="CC",
): ):
cfileimpl(self, name, srcs, deps, suffix, commands, label, cflags) cfileimpl(self, name, srcs, deps, suffix, commands, label, cflags)
@@ -75,33 +77,49 @@ def cxxfile(
deps: Targets = None, deps: Targets = None,
cflags=[], cflags=[],
suffix=".o", suffix=".o",
commands=["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], commands=["$(CXX) -c -o $[outs[0]] $[ins[0]] $(CFLAGS) $[cflags]"],
label="CXX", label="CXX",
): ):
cfileimpl(self, name, srcs, deps, suffix, commands, label, cflags) 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): def findsources(name, srcs, deps, cflags, filerule, cwd):
for f in filenamesof(srcs): for f in filenamesof(srcs):
if f.endswith(".h") or f.endswith(".hh"): if not _isSourceFile(f):
cflags = cflags + [f"-I{dirname(f)}"] cflags = cflags + [f"-I{dirname(f)}"]
deps = deps + [f]
objs = [] objs = []
for s in flatten(srcs): for s in flatten(srcs):
objs += [ objs += [
filerule( filerule(
name=join(name, f.removeprefix("$(OBJ)/")), name=join(name, _removeprefix(f, "$(OBJ)/")),
srcs=[f], srcs=[f],
deps=deps, deps=deps,
cflags=sorted(set(cflags)), cflags=sorted(set(cflags)),
cwd=cwd, cwd=cwd,
) )
for f in filenamesof([s]) for f in filenamesof([s])
if f.endswith(".c") if _isSourceFile(f)
or f.endswith(".cc")
or f.endswith(".cpp")
or f.endswith(".S")
or f.endswith(".s")
] ]
if any(f.endswith(".o") for f in filenamesof([s])): if any(f.endswith(".o") for f in filenamesof([s])):
objs += [s] objs += [s]
@@ -140,7 +158,7 @@ def libraryimpl(
len(s) == 1 len(s) == 1
), "the target of a header must return exactly one file" ), "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] outs += ["=" + dest]
i = i + 1 i = i + 1
@@ -194,7 +212,7 @@ def clibrary(
caller_ldflags=[], caller_ldflags=[],
cflags=[], cflags=[],
ldflags=[], ldflags=[],
commands=["rm -f {outs[0]} && $(AR) cqs {outs[0]} {ins}"], commands=["rm -f $[outs[0]] && $(AR) cqs $[outs[0]] $[ins]"],
label="LIB", label="LIB",
cfilerule=cfile, cfilerule=cfile,
): ):
@@ -225,7 +243,7 @@ def cxxlibrary(
caller_ldflags=[], caller_ldflags=[],
cflags=[], cflags=[],
ldflags=[], ldflags=[],
commands=["rm -f {outs[0]} && $(AR) cqs {outs[0]} {ins}"], commands=["rm -f $[outs[0]] && $(AR) cqs $[outs[0]] $[ins]"],
label="CXXLIB", label="CXXLIB",
cxxfilerule=cxxfile, cxxfilerule=cxxfile,
): ):
@@ -290,7 +308,7 @@ def cprogram(
cflags=[], cflags=[],
ldflags=[], ldflags=[],
commands=[ commands=[
"$(CC) -o {outs[0]} $(STARTGROUP) {ins} {ldflags} $(LDFLAGS) $(ENDGROUP)" "$(CC) -o $[outs[0]] $(STARTGROUP) $[ins] $[ldflags] $(LDFLAGS) $(ENDGROUP)"
], ],
label="CLINK", label="CLINK",
cfilerule=cfile, cfilerule=cfile,
@@ -317,7 +335,7 @@ def cxxprogram(
cflags=[], cflags=[],
ldflags=[], ldflags=[],
commands=[ commands=[
"$(CXX) -o {outs[0]} $(STARTGROUP) {ins} {ldflags} $(LDFLAGS) $(ENDGROUP)" "$(CXX) -o $[outs[0]] $(STARTGROUP) $[ins] $[ldflags] $(LDFLAGS) $(ENDGROUP)"
], ],
label="CXXLINK", label="CXXLINK",
cxxfilerule=cxxfile, cxxfilerule=cxxfile,

View File

@@ -50,7 +50,7 @@ def _package(self, name, package, fallback, pkgconfig):
assert ( assert (
fallback 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: if "cheader_deps" in fallback.args:
self.args["cheader_deps"] = fallback.args["cheader_deps"] self.args["cheader_deps"] = fallback.args["cheader_deps"]

View File

@@ -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( simplerule(
replaces=self, replaces=self,
ins=srcs, ins=srcs,
@@ -39,9 +39,9 @@ def proto(self, name, srcs: Targets = [], deps: Targets = []):
deps=protodeps, deps=protodeps,
commands=( commands=(
["mkdir -p " + (" ".join(dirs))] ["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( " ".join(
[ [
@@ -55,7 +55,7 @@ def proto(self, name, srcs: Targets = [], deps: Targets = []):
if descriptorlist if descriptorlist
else [] else []
) )
+ ["{ins}"] + ["$[ins]"]
) )
) )
] ]
@@ -96,7 +96,7 @@ def protocc(self, name, srcs: Targets = [], deps: Targets = []):
outs=outs, outs=outs,
deps=protodeps, deps=protodeps,
commands=[ commands=[
"cd {dir} && " "cd $[dir] && "
+ ( + (
" ".join( " ".join(
[ [
@@ -146,8 +146,8 @@ def protojava(self, name, srcs: Targets = [], deps: Targets = []):
outs=[f"={self.localname}.srcjar"], outs=[f"={self.localname}.srcjar"],
deps=srcs + deps, deps=srcs + deps,
commands=[ commands=[
"mkdir -p {dir}/srcs", "mkdir -p $[dir]/srcs",
"cd {dir} && " "cd $[dir]/srcs && "
+ ( + (
" ".join( " ".join(
[ [
@@ -159,7 +159,7 @@ def protojava(self, name, srcs: Targets = [], deps: Targets = []):
+ protos + protos
) )
), ),
"$(JAR) cf {outs[0]} -C {dir}/srcs .", "$(JAR) cf $[outs[0]] -C $[dir]/srcs .",
], ],
traits={"srcjar"}, traits={"srcjar"},
label="PROTOJAVA", label="PROTOJAVA",

View File

@@ -58,7 +58,7 @@ def objectify(self, name, src: Target, symbol):
replaces=self, replaces=self,
ins=["build/_objectify.py", src], ins=["build/_objectify.py", src],
outs=[f"={basename(filenameof(src))}.h"], outs=[f"={basename(filenameof(src))}.h"],
commands=["$(PYTHON) {ins[0]} {ins[1]} " + symbol + " > {outs}"], commands=["$(PYTHON) $[ins[0]] $[ins[1]] " + symbol + " > $[outs]"],
label="OBJECTIFY", label="OBJECTIFY",
) )
@@ -78,7 +78,7 @@ def test(
replaces=self, replaces=self,
ins=[command], ins=[command],
outs=["=sentinel"], outs=["=sentinel"],
commands=["{ins[0]}", "touch {outs}"], commands=["$[ins[0]]", "touch $[outs]"],
deps=deps, deps=deps,
label=label, label=label,
) )
@@ -87,7 +87,7 @@ def test(
replaces=self, replaces=self,
ins=ins, ins=ins,
outs=["=sentinel"], outs=["=sentinel"],
commands=commands + ["touch {outs}"], commands=commands + ["touch $[outs]"],
deps=deps, deps=deps,
label=label, label=label,
) )

View File

@@ -3,14 +3,6 @@ from build.ab import (
simplerule, simplerule,
TargetsMap, TargetsMap,
filenameof, filenameof,
emit,
)
emit(
"""
ZIP ?= zip
ZIPNOTE ?= zipnote
"""
) )
@@ -18,20 +10,18 @@ ZIPNOTE ?= zipnote
def zip( def zip(
self, name, flags="", items: TargetsMap = {}, extension="zip", label="ZIP" self, name, flags="", items: TargetsMap = {}, extension="zip", label="ZIP"
): ):
cs = ["rm -f {outs[0]}"] cs = ["$(PYTHON) build/_zip.py -z $[outs]"]
ins = [] ins = []
for k, v in items.items(): for k, v in items.items():
cs += [ cs += [f"-f {k} {filenameof(v)}"]
"cat %s | $(ZIP) -q %s {outs[0]} -" % (filenameof(v), flags),
"printf '@ -\\n@=%s\\n' | $(ZIPNOTE) -w {outs[0]}" % k,
]
ins += [v] ins += [v]
simplerule( simplerule(
replaces=self, replaces=self,
ins=ins, ins=ins,
deps=["build/_zip.py"],
outs=[f"={self.localname}." + extension], outs=[f"={self.localname}." + extension],
commands=cs, commands=[" ".join(cs)],
label=label, label=label,
) )

View File

@@ -4,17 +4,28 @@ clibrary(
name="hfsutils", name="hfsutils",
srcs=[ srcs=[
"./libhfs/block.c", "./libhfs/block.c",
"./libhfs/block.h",
"./libhfs/btree.c", "./libhfs/btree.c",
"./libhfs/btree.h",
"./libhfs/data.c", "./libhfs/data.c",
"./libhfs/data.h",
"./libhfs/file.c", "./libhfs/file.c",
"./libhfs/file.h",
"./libhfs/hfs.c", "./libhfs/hfs.c",
"./libhfs/hfs.h",
"./libhfs/low.c", "./libhfs/low.c",
"./libhfs/low.h",
"./libhfs/medium.c", "./libhfs/medium.c",
"./libhfs/medium.h",
"./libhfs/memcmp.c", "./libhfs/memcmp.c",
"./libhfs/node.c", "./libhfs/node.c",
"./libhfs/node.h",
"./libhfs/record.c", "./libhfs/record.c",
"./libhfs/record.h",
"./libhfs/version.c", "./libhfs/version.c",
"./libhfs/version.h",
"./libhfs/volume.c", "./libhfs/volume.c",
"./libhfs/volume.h",
], ],
hdrs={ hdrs={
"apple.h": "./libhfs/apple.h", "apple.h": "./libhfs/apple.h",

View File

@@ -19,8 +19,8 @@ simplerule(
ins=["./icon.png"], ins=["./icon.png"],
outs=["=fluxengine.iconset"], outs=["=fluxengine.iconset"],
commands=[ commands=[
"mkdir -p {outs[0]}", "mkdir -p $[outs[0]]",
"sips -z 64 64 {ins[0]} --out {outs[0]}/icon_32x32@2x.png > /dev/null", "sips -z 64 64 $[ins[0]] --out $[outs[0]]/icon_32x32@2x.png > /dev/null",
], ],
label="ICONSET", label="ICONSET",
) )
@@ -29,7 +29,7 @@ simplerule(
name="fluxengine_icns", name="fluxengine_icns",
ins=[".+fluxengine_iconset"], ins=[".+fluxengine_iconset"],
outs=["=fluxengine.icns"], outs=["=fluxengine.icns"],
commands=["iconutil -c icns -o {outs[0]} {ins[0]}"], commands=["iconutil -c icns -o $[outs[0]] $[ins[0]]"],
label="ICONUTIL", label="ICONUTIL",
) )
@@ -37,6 +37,6 @@ simplerule(
name="fluxengine_ico", name="fluxengine_ico",
ins=["./icon.png"], ins=["./icon.png"],
outs=["=fluxengine.ico"], outs=["=fluxengine.ico"],
commands=["png2ico {outs[0]} {ins[0]}"], commands=["png2ico $[outs[0]] $[ins[0]]"],
label="MAKEICON", label="MAKEICON",
) )

View File

@@ -1,7 +1,7 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "protocol.h" #include "protocol.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "greaseweazle.h" #include "lib/external/greaseweazle.h"
Bytes fluxEngineToGreaseweazle(const Bytes& fldata, nanoseconds_t clock) Bytes fluxEngineToGreaseweazle(const Bytes& fldata, nanoseconds_t clock)
{ {

View File

@@ -4,8 +4,8 @@
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/usb/usb.pb.h" #include "lib/usb/usb.pb.h"
#include "lib/core/utils.h" #include "lib/core/utils.h"
#include "serial.h" #include "lib/usb/serial.h"
#include "usb.h" #include "lib/usb/usb.h"
#include "lib/data/fluxmapreader.h" #include "lib/data/fluxmapreader.h"
#include <unistd.h> #include <unistd.h>

View File

@@ -16,6 +16,6 @@ cxxlibrary(
"./usb.cc", "./usb.cc",
"./usbfinder.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"], deps=["lib/core", "lib/config", "lib/external", "dep/libusbp", "+protocol"],
) )

View File

@@ -1,5 +1,5 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "usb.h" #include "lib/usb/usb.h"
#include "protocol.h" #include "protocol.h"
#include "lib/data/fluxmap.h" #include "lib/data/fluxmap.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"

View File

@@ -4,8 +4,8 @@
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/usb/usb.pb.h" #include "lib/usb/usb.pb.h"
#include "lib/external/greaseweazle.h" #include "lib/external/greaseweazle.h"
#include "serial.h" #include "lib/usb/serial.h"
#include "usb.h" #include "lib/usb/usb.h"
#include <unistd.h> #include <unistd.h>
static const char* gw_error(int e) static const char* gw_error(int e)

View File

@@ -1,9 +1,9 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "usb.h" #include "lib/usb/usb.h"
#include "protocol.h" #include "protocol.h"
#include "lib/data/fluxmap.h" #include "lib/data/fluxmap.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "serial.h" #include "lib/usb/serial.h"
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@@ -1,14 +1,14 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/config/config.h" #include "lib/config/config.h"
#include "lib/config/flags.h" #include "lib/config/flags.h"
#include "usb.h" #include "lib/usb/usb.h"
#include "libusbp_config.h" #include "libusbp_config.h"
#include "libusbp.hpp" #include "libusbp.hpp"
#include "protocol.h" #include "protocol.h"
#include "lib/data/fluxmap.h" #include "lib/data/fluxmap.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "lib/config/proto.h" #include "lib/config/proto.h"
#include "usbfinder.h" #include "lib/usb/usbfinder.h"
#include "lib/core/logger.h" #include "lib/core/logger.h"
#include "lib/external/applesauce.h" #include "lib/external/applesauce.h"
#include "lib/external/greaseweazle.h" #include "lib/external/greaseweazle.h"

View File

@@ -1,8 +1,8 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/config/flags.h" #include "lib/config/flags.h"
#include "usb.h" #include "lib/usb/usb.h"
#include "lib/core/bytes.h" #include "lib/core/bytes.h"
#include "usbfinder.h" #include "lib/usb/usbfinder.h"
#include "lib/external/applesauce.h" #include "lib/external/applesauce.h"
#include "lib/external/greaseweazle.h" #include "lib/external/greaseweazle.h"
#include "protocol.h" #include "protocol.h"

View File

@@ -1,6 +1,6 @@
#include "lib/core/globals.h" #include "lib/core/globals.h"
#include "lib/config/config.h" #include "lib/config/config.h"
#include "vfs.h" #include "lib/vfs/vfs.h"
#include "lib/config/proto.h" #include "lib/config/proto.h"
#include "lib/config/layout.pb.h" #include "lib/config/layout.pb.h"
#include "lib/data/layout.h" #include "lib/data/layout.h"

View File

@@ -30,7 +30,7 @@ def protoencode_single(self, name, srcs: Targets, proto, symbol):
ins=srcs, ins=srcs,
outs=[f"={name}.cc"], outs=[f"={name}.cc"],
deps=[r], deps=[r],
commands=["{deps[0]} {ins} {outs} " + symbol], commands=["$[deps[0]] $[ins] $[outs] " + symbol],
label="PROTOENCODE", label="PROTOENCODE",
) )
@@ -51,7 +51,7 @@ def protoencode(self, name, proto, srcs: TargetsMap, symbol):
replaces=self, replaces=self,
ins=encoded, ins=encoded,
outs=[f"={name}.cc"], outs=[f"={name}.cc"],
commands=["cat {ins} > {outs}"], commands=["cat $[ins] > $[outs]"],
label="CONCAT", label="CONCAT",
) )

View File

@@ -4,6 +4,7 @@ cxxprogram(
name="fluxengine", name="fluxengine",
srcs=[ srcs=[
"./fluxengine.cc", "./fluxengine.cc",
"./fluxengine.h",
"./fe-analysedriveresponse.cc", "./fe-analysedriveresponse.cc",
"./fe-analyselayout.cc", "./fe-analyselayout.cc",
"./fe-format.cc", "./fe-format.cc",
@@ -27,6 +28,7 @@ cxxprogram(
"./fe-testvoltages.cc", "./fe-testvoltages.cc",
"./fe-write.cc", "./fe-write.cc",
"./fileutils.cc", "./fileutils.cc",
"./fileutils.h",
], ],
cflags=["-I."], cflags=["-I."],
deps=[ deps=[

View File

@@ -47,7 +47,7 @@ simplerule(
deps=["scripts/mktable.sh"], deps=["scripts/mktable.sh"],
outs=["=table.cc"], outs=["=table.cc"],
commands=[ commands=[
"sh scripts/mktable.sh formats " + (" ".join(formats)) + " > {outs}" "sh scripts/mktable.sh formats " + (" ".join(formats)) + " > $[outs]"
], ],
label="MKTABLE", label="MKTABLE",
) )
@@ -72,7 +72,7 @@ export(
name=f"{f}_doc", name=f"{f}_doc",
ins=["scripts+mkdoc"], ins=["scripts+mkdoc"],
outs=[f"=disk-{f}.md"], 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", label="MKDOC",
) )
for f in formats for f in formats

View File

@@ -1,5 +1,6 @@
from build.ab import emit, simplerule from build.ab import emit, simplerule
from build.c import cxxprogram from build.c import cxxprogram
from glob import glob
import config import config
emit( emit(
@@ -23,35 +24,15 @@ if config.windows:
ins=["./windres.rc"], ins=["./windres.rc"],
outs=["=rc.o"], outs=["=rc.o"],
deps=["./manifest.xml", "extras+fluxengine_ico"], deps=["./manifest.xml", "extras+fluxengine_ico"],
commands=["$(WINDRES) {ins[0]} {outs[0]}"], commands=["$(WINDRES) $[ins[0]] $[outs[0]]"],
label="WINDRES", label="WINDRES",
) )
] ]
cxxprogram( cxxprogram(
name="gui", name="gui",
srcs=[ srcs=glob("*.c", root_dir="src/gui") +
"./browserpanel.cc", glob("*.h", root_dir="src/gui")
"./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",
]
+ extrasrcs, + extrasrcs,
cflags=["$(WX_CFLAGS)"], cflags=["$(WX_CFLAGS)"],
ldflags=["$(WX_LDFLAGS)"], ldflags=["$(WX_LDFLAGS)"],
@@ -82,7 +63,7 @@ if config.osx:
ins=[".+fluxengine_app"], ins=[".+fluxengine_app"],
outs=["=FluxEngine.pkg"], outs=["=FluxEngine.pkg"],
commands=[ commands=[
"pkgbuild --quiet --install-location /Applications --component {ins[0]} {outs[0]}" "pkgbuild --quiet --install-location /Applications --component $[ins[0]] $[outs[0]]"
], ],
label="PKGBUILD", label="PKGBUILD",
) )
@@ -96,21 +77,21 @@ if config.osx:
], ],
outs=["=FluxEngine.app"], outs=["=FluxEngine.app"],
commands=[ commands=[
"rm -rf {outs[0]}", "rm -rf $[outs[0]]",
"cp -a {ins[2]} {outs[0]}", "cp -a $[ins[2]] $[outs[0]]",
"touch {outs[0]}", "touch $[outs[0]]",
"cp {ins[0]} {outs[0]}/Contents/MacOS/fluxengine-gui", "cp $[ins[0]] $[outs[0]]/Contents/MacOS/fluxengine-gui",
"mkdir -p {outs[0]}/Contents/Resources", "mkdir -p $[outs[0]]/Contents/Resources",
"cp {ins[1]} {outs[0]}/Contents/Resources/FluxEngine.icns", "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", "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 wxwidgets)/README.md $[outs[0]]/Contents/libs/wxWidgets.md",
"cp $$(brew --prefix protobuf)/LICENSE {outs[0]}/Contents/libs/protobuf.txt", "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 fmt)/LICENSE* $[outs[0]]/Contents/libs/fmt.rst",
"cp $$(brew --prefix libpng)/LICENSE {outs[0]}/Contents/libs/libpng.txt", "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 libjpeg)/README $[outs[0]]/Contents/libs/libjpeg.txt",
"cp $$(brew --prefix abseil)/LICENSE {outs[0]}/Contents/libs/abseil.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 libtiff)/LICENSE.md $[outs[0]]/Contents/libs/libtiff.txt",
"cp $$(brew --prefix zstd)/LICENSE {outs[0]}/Contents/libs/zstd.txt", "cp $$(brew --prefix zstd)/LICENSE $[outs[0]]/Contents/libs/zstd.txt",
], ],
label="MKAPP", label="MKAPP",
) )

View File

@@ -16,7 +16,7 @@ simplerule(
commands=[ commands=[
"sh scripts/mktable.sh drivetypes " "sh scripts/mktable.sh drivetypes "
+ (" ".join(drivetypes)) + (" ".join(drivetypes))
+ " > {outs}" + " > $[outs]"
], ],
label="MKTABLE", label="MKTABLE",
) )

View File

@@ -83,7 +83,7 @@ export(
name=f"{n}_test", name=f"{n}_test",
command=cxxprogram( command=cxxprogram(
name=f"{n}_test_exe", name=f"{n}_test_exe",
srcs=[f"./{n}.cc"], srcs=[f"./{n}.cc", "./tests.h"],
deps=[ deps=[
"lib/external+fl2_proto_lib", "lib/external+fl2_proto_lib",
"+fmt_lib", "+fmt_lib",