Skip to content

Commit

Permalink
Merge pull request #69 from davidgiven/ab
Browse files Browse the repository at this point in the history
Switch build system from bazel to ab.
  • Loading branch information
davidgiven committed Sep 10, 2024
2 parents 7c8d636 + 9a50aea commit 21c02a2
Show file tree
Hide file tree
Showing 88 changed files with 2,718 additions and 1,642 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: apt
run: |
sudo apt update
sudo apt install cpmtools bazel-bootstrap flex bison libreadline-dev libz80ex-dev lua5.2
sudo apt install cpmtools flex bison libreadline-dev libz80ex-dev lua5.2
- name: build-ack
run: |
git clone --depth=1 https://github.com/davidgiven/ack.git
Expand All @@ -30,11 +30,11 @@ jobs:
with:
name: ${{ github.event.repository.name }}.${{ github.sha }}
path: |
bazel-bin/arch/brother/pn8510/diskimage.img
bazel-bin/arch/brother/pn8800/diskimage.img
bazel-bin/arch/brother/lw30/diskimage.img
bazel-bin/arch/brother/wp2450/diskimage.img
bazel-bin/arch/brother/wp1/diskimage.img
bazel-bin/arch/kayproii/diskimage.img
bazel-bin/arch/nc200/diskimage.img
pn8510.img
pn8800.img
lw30.img
wp2450.img
wp1.img
kayproii.img
nc200.img
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: apt
run: |
sudo apt update
sudo apt install cpmtools bazel-bootstrap flex bison libreadline-dev libz80ex-dev lua5.2
sudo apt install cpmtools flex bison libreadline-dev libz80ex-dev lua5.2
- name: build-ack
run: |
Expand Down Expand Up @@ -49,7 +49,6 @@ jobs:
token: ${{ github.token }}
tag: dev
assets: |
pn8510.img
pn8510.img
pn8800.img
brotherop2.img
Expand Down
2 changes: 2 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.obj
.vscode
__pycache__
.*\.orig

17 changes: 0 additions & 17 deletions BUILD

This file was deleted.

16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
all:
bazel test -c dbg //...
bazel build -c opt //:diskimages
for a in $$(dirname bazel-bin/arch/*/diskimage.img bazel-bin/arch/*/*/diskimage.img); do \
f=$$(basename $$a); cp $$a/diskimage.img $$f.img; chmod +rw $$f.img; done
export ACKCFLAGS = -O3
export OBJ = .obj

verbose:
bazel test -s -c dbg //...
bazel build -s -c opt //:diskimages
.PHONY: all
all: +all

clean:
bazel clean
TARGETS = +all
include build/ab.mk
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ This are built automatically and aren't tested in any way.
need to install the dependencies. These are the names of the Debian packages:

- cpmtools
- bazel-bootstrap
- libz80ex-dev
- libreadline-dev

Expand Down
Empty file removed WORKSPACE
Empty file.
109 changes: 0 additions & 109 deletions arch/brother/lw30/BUILD

This file was deleted.

83 changes: 83 additions & 0 deletions arch/brother/lw30/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from build.ab import simplerule
from build.cpm import cpm_addresses, binslice, diskimage
from third_party.zmac.build import zmac
from third_party.ld80.build import ld80
from utils.build import unix2cpm

simplerule(
name="font_inc",
ins=["arch/brother/lw30/utils+fontconvert", "utils/6x7font.bdf"],
outs=["=font.inc"],
commands=["{ins[0]} {ins[1]} > {outs[0]}"],
label="FONTCONVERT",
)

zmac(
name="boot_o",
z180=True,
src="./boot.z80",
deps=[
"arch/brother/lw30/include/lw30.lib",
"arch/common/utils/tty.lib",
"include/cpmish.lib",
"include/z180.lib",
".+font_inc",
],
)

ld80(name="boot", address=0x5000, objs={0x5000: [".+boot_o"]})

for n in ["bios", "floppy", "tty"]:
zmac(
name=n,
z180=True,
src=f"./{n}.z80",
deps=[
"arch/brother/lw30/include/lw30.lib",
"arch/common/utils/print.lib",
"arch/common/utils/tty.lib",
"include/cpm.lib",
"include/cpmish.lib",
"include/z180.lib",
],
)

# This is the bit which CP/M reloads on warm boot (well, some of it).
ld80(
name="cpmfile",
address=0x9300,
objs={
0x9300: ["third_party/zcpr1"],
0x9B00: ["third_party/zsdos"],
0xA900: [
".+bios",
".+floppy",
".+tty",
],
},
)

# Produces the FAT bit of the disk image.
zmac(name="fat", z180=True, src="./fat.z80", deps=[".+boot", ".+cpmfile"])

ld80(name="bootfile", objs={0x0000: [".+fat"]})

unix2cpm(name="readme", src="README.md")

diskimage(
name="diskimage",
format="brother-op2",
bootfile=".+bootfile",
map={
"-readme.txt": ".+readme",
"dump.com": "cpmtools+dump",
"stat.com": "cpmtools+stat",
"asm.com": "cpmtools+asm",
"copy.com": "cpmtools+copy",
"submit.com": "cpmtools+submit",
"rawdisk.com": "cpmtools+rawdisk",
"bbcbasic.com": "third_party/bbcbasic+bbcbasic_ADM3A",
"camel80.com": "third_party/camelforth",
"qe.com": "cpmtools+qe_BROTHEROP2",
},
)
5 changes: 0 additions & 5 deletions arch/brother/lw30/include/BUILD

This file was deleted.

8 changes: 0 additions & 8 deletions arch/brother/lw30/utils/BUILD

This file was deleted.

3 changes: 3 additions & 0 deletions arch/brother/lw30/utils/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from build.c import cprogram

cprogram(name="fontconvert", srcs=["./fontconvert.c"], deps=["utils+libbdf"])
Loading

0 comments on commit 21c02a2

Please sign in to comment.