From 1234e81463c495d354b411ad817e3e54508e46a3 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 12 Dec 2023 23:11:09 +0100 Subject: [PATCH] Update ab. You can now build individual tools individually. --- build.py | 1 + build/ab.py | 15 ++++++++------- build/pkg.py | 4 +++- src/gui/build.py | 7 ++++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/build.py b/build.py index f07775e35..d92c38455 100644 --- a/build.py +++ b/build.py @@ -227,6 +227,7 @@ print("fluxengine-testdata not found; skipping corpus tests") else: corpus = [ + ("acorndfs", "", "--200"), ("agat", "", ""), ("amiga", "", ""), ("apple2", "", "--140 40track_drive"), diff --git a/build/ab.py b/build/ab.py index 276545686..d53938671 100644 --- a/build/ab.py +++ b/build/ab.py @@ -417,8 +417,6 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): for dest, src in items.items(): destf = filenameof(dest) dir = dirname(destf) - if dir: - cs += ["mkdir -p " + dir] srcs = filenamesof(src) if len(srcs) != 1: @@ -426,13 +424,16 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): "a dependency of an export must have exactly one output file" ) - cs += ["cp %s %s" % (srcs[0], destf)] - self.outs += [destf] + emitter_rule(self.name + "+" + destf, srcs, [destf]) + emitter_label(f"CP {destf}") + if dir: + emitter_exec(["mkdir -p " + dir]) - emitter_rule(self.name, items.values(), self.outs, deps) - emitter_label(f"EXPORT {self.name}") + emitter_exec(["cp %s %s" % (srcs[0], destf)]) + self.outs += [destf] - emitter_exec(cs) + emitter_rule(self.name, self.outs, [], deps) + emit("\t@") if self.outs: emit("clean::") diff --git a/build/pkg.py b/build/pkg.py index c1c98f47d..e6a10bb33 100644 --- a/build/pkg.py +++ b/build/pkg.py @@ -6,7 +6,9 @@ emit( """ PKG_CONFIG ?= pkg-config -PACKAGES := $(shell $(PKG_CONFIG) --list-all | cut -d' ' -f1) +PACKAGES := $(shell $(PKG_CONFIG) --list-all | cut -d' ' -f1 | sort) +PCFILES := $(wildcard $(patsubst %,%/*.pc,$(subst :, ,$(shell $(PKG_CONFIG) --variable pc_path pkg-config)))) +$(OBJ)/build.mk: $(PCFILES) """ ) diff --git a/src/gui/build.py b/src/gui/build.py index a71181618..f2d85c232 100644 --- a/src/gui/build.py +++ b/src/gui/build.py @@ -6,11 +6,12 @@ """ WX_CONFIG ?= wx-config ifneq ($(strip $(shell command -v $(WX_CONFIG) >/dev/null 2>&1; echo $$?)),0) -$(error Required binary 'wx-config' not found.) -endif - +WX_CFLAGS = $(error Required binary 'wx-config' not found.) +WX_LDFLAGS = $(error Required binary 'wx-config' not found.) +else WX_CFLAGS := $(shell $(WX_CONFIG) --cxxflags core base adv aui richtext) WX_LDFLAGS := $(shell $(WX_CONFIG) --libs core base adv aui richtext) +endif """ )