Skip to content

Commit

Permalink
Merge pull request #130 from davidgiven/ab22
Browse files Browse the repository at this point in the history
Replace the build system... again.
  • Loading branch information
davidgiven authored Mar 5, 2023
2 parents f31403c + 86b9650 commit ec6d1d3
Show file tree
Hide file tree
Showing 116 changed files with 2,414 additions and 2,112 deletions.
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

0 comments on commit ec6d1d3

Please sign in to comment.