Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the build system... again. #130

Merged
merged 40 commits into from
Mar 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7434214
Create new branch named "ab22"
Mar 5, 2023
68fd6b4
First very prototype version of ab2.
Mar 5, 2023
73a2107
Most of the rule engine seems to work, including inherited variables.
Mar 5, 2023
f845fad
I think the new build system may actually be working!
Mar 5, 2023
411da48
Actually start building some programs.
Mar 5, 2023
9fce893
Build more things.
Mar 5, 2023
f33b269
Build even more things. Better proxies, don't write to stdout.
Mar 5, 2023
d4b88df
Replace proxies with replacement.
Mar 5, 2023
f683d43
Build more things.
Mar 5, 2023
7f86e0a
Start thinking about toolchains.
Mar 5, 2023
fa0a265
Finally update to emit .coh files.
Mar 5, 2023
e4b28ac
Most of cowfe and cowbe build.
Mar 5, 2023
b38092e
Rename installable -> export.
Mar 5, 2023
5aca409
Build cowlink.
Mar 5, 2023
ba1aa06
Build cowwrap.
Mar 5, 2023
a10f9c6
Finally build our first programs!
Mar 5, 2023
409897e
Rename outleaves -> outs.
Mar 5, 2023
b5aa4e1
More toolchains.
Mar 5, 2023
e76ac50
Fix export dependencies.
Mar 5, 2023
66f4dd1
Fix export dependencies... again.
Mar 5, 2023
1f90e99
More toolchains. Add missing files.
Mar 5, 2023
fb119d5
Add the rest of the toolchains.
Mar 5, 2023
bb4f037
Avoid a build cycle. Add tools to detect build cycles.
Mar 5, 2023
b109e96
Detect whether tools are available.
Mar 5, 2023
ee02d1f
Update build script
Mar 5, 2023
bb23c08
Actually run some tests.
Mar 5, 2023
3768368
Don't use inspect in the critical path; massive performance boosts. T…
Mar 5, 2023
6a405b1
Lots more test suites work.
Mar 5, 2023
d1acd90
Add the rest of the tests. Is it all done now?
Mar 5, 2023
da6c308
Build some more small things.
Mar 5, 2023
d43a507
Build a bunch of distributions.
Mar 5, 2023
45afd0c
Rework types. Built the bbct distribution.
Mar 5, 2023
9a2b27d
Clean up the config stuff a bit.
Mar 5, 2023
685d1ec
Generate ninjafiles instead of makefiles.
Mar 5, 2023
e6e62c7
Remove the obsolete lua files.
Mar 5, 2023
5b4d5a3
Generate consistent ninja files.
Mar 5, 2023
b896b0e
Update documentation.
Mar 5, 2023
a9c2679
Fix out-of-range jump preventing some large PowerPC programs being as…
Mar 5, 2023
e7f61dd
Cross-build most of the tools.
Mar 5, 2023
86b9650
Typo fixes.
Mar 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on: [push]

jobs:
build-linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: apt update
run: sudo apt update
- name: add-apt-repository
run: sudo add-apt-repository ppa:vriviere/ppa -y
- name: apt
run: sudo apt install ninja-build lua5.1 pasmo libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm
run: sudo apt install ninja-build lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm
- name: make
run: make NINJAFLAGS=-k1

33 changes: 25 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
export OBJ = .obj
export LUA = lua
export CC = gcc
export CXX = g++
export AR = ar
export CFLAGS = -g -O0
export LDFLAGS = -g
export NINJAFLAGS =

all: $(OBJ)/build.ninja
@ninja -f $(OBJ)/build.ninja $(NINJAFLAGS)
export PYTHONHASHSEED = 1

#all: $(OBJ)/build.mk
# @+make -f $(OBJ)/build.mk +all

all: $(OBJ)/build.ninja
@ninja -f $< +all

clean:
@echo CLEAN
@rm -rf $(OBJ) bin

lua-files = $(shell find . -name 'build*.lua') $(wildcard build/*.lua) toolchains.lua
$(OBJ)/build.ninja: mkninja.lua Makefile $(lua-files)
@echo MKNINJA
build-files = $(shell find . -name 'build.py') build/*.py config.py
$(OBJ)/build.mk: Makefile $(build-files)
@echo ACKBUILDER
@mkdir -p $(OBJ)
@$(LUA) \
mkninja.lua \
> $@
@python3 -X pycache_prefix=$(OBJ) build/ab2.py -m make -t +all -o $@ build.py

$(OBJ)/build.ninja: Makefile $(build-files)
@echo ACKBUILDER
@mkdir -p $(OBJ)
@python3 -X pycache_prefix=$(OBJ) build/ab2.py -m ninja -t +all -o $@ \
-v OBJ,CC,CXX,AR \
build.py

.DELETE_ON_ERROR:
.SECONDARY:

20 changes: 0 additions & 20 deletions bootstrap/build.lua

This file was deleted.

6 changes: 6 additions & 0 deletions bootstrap/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from src.toolchains import cgen

cgen(name="cowfe", srcs=["./cowfe-cgen.bootstrap.c"])
cgen(name="cowbe", srcs=["./cowbe-cgen.bootstrap.c"])
cgen(name="cowlink", srcs=["./cowlink-cgen.bootstrap.c"])
cgen(name="cowwrap", srcs=["./cowwrap.bootstrap.c"])
38 changes: 38 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from build.ab2 import Rule, export
from os.path import *
import config

export(
name="all",
items={
"bin/tubeemu": "tools/tubeemu",
"bin/obpemu": "tools/obpemu",
"bin/mkadfs": "tools+mkadfs",
"bin/mkdfs": "tools+mkdfs",
"bin/apout": "third_party/apout",
"bin/emu2": "third_party/emu2",
"bin/zmac": "third_party/zmac",
"bin/cpmemu": "tools/cpmemu",
"bin/ataritosemu": "tools/ataritosemu",
"bin/lx68kemu": "tools/lx68kemu",
"bin/fuzix6303emu": "tools/fuzix6303emu",
"bin/cowdis-tlcs90": "src/cowdis+cowdis-for-tlcs90-with-nncgen",
"bin/cowbdmp": "src/cowbdmp+cowbdmp-with-nncgen",
"bin/basicify": "src/misc+basicify-with-nncgen",
},
deps=[
"dist/cpm",
"dist/cpmz",
"examples",
"src/cowasm",
"src/cowbe",
"src/cowfe",
"src/cowlink",
"src/cowwrap",
"tests",
"third_party/djlink+djlink-programs",
]
+ (["dist/msdos"] if config.has_msdos else [])
+ (["dist/ataritos"] if config.has_ataritos else [])
+ (["dist/bbct"] if config.has_bbct else []),
)
Loading