Skip to content

Commit

Permalink
Update ab. You can now build individual tools individually.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Dec 12, 2023
1 parent ea13d66 commit 1234e81
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
print("fluxengine-testdata not found; skipping corpus tests")
else:
corpus = [
("acorndfs", "", "--200"),
("agat", "", ""),
("amiga", "", ""),
("apple2", "", "--140 40track_drive"),
Expand Down
15 changes: 8 additions & 7 deletions build/ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,22 +417,23 @@ 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:
raise ABException(
"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::")
Expand Down
4 changes: 3 additions & 1 deletion build/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
"""
)

Expand Down
7 changes: 4 additions & 3 deletions src/gui/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
)

Expand Down

0 comments on commit 1234e81

Please sign in to comment.