2026-07-06 09:49:50 +02:00
|
|
|
# Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
|
|
# gasm-devkit — developer tooling for Go's Plan 9 assembler (GAsm).
|
|
|
|
|
|
2026-08-24 21:03:30 +02:00
|
|
|
version := "0.32.0-dev"
|
2026-07-06 09:49:50 +02:00
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
@just --list
|
|
|
|
|
|
|
|
|
|
# Download module dependencies.
|
|
|
|
|
install:
|
|
|
|
|
go mod download
|
|
|
|
|
|
|
|
|
|
# Vet + gofmt check — zero errors, zero warnings.
|
|
|
|
|
build:
|
|
|
|
|
go vet ./...
|
|
|
|
|
@test -z "$(gofmt -l .)" || { echo "gofmt diff:"; gofmt -l .; exit 1; }
|
|
|
|
|
|
|
|
|
|
# Full test suite + race detector + 80 % coverage gate.
|
2026-08-07 21:34:09 +02:00
|
|
|
# The coverage gate matches CI: it excludes packages that need hardware or
|
|
|
|
|
# are CLI glue (debug, cmd/gasm), so the number is identical locally and in CI.
|
2026-07-06 09:49:50 +02:00
|
|
|
test:
|
2026-08-07 21:34:09 +02:00
|
|
|
go test -race -count=1 ./...
|
|
|
|
|
go test -count=1 -coverprofile=coverage.out \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/arch \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/asm \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/ast \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/format \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/lexer \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/lint \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/lsp \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/parser \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/token \
|
|
|
|
|
sourcedock.dev/petrbalvin/gasm-devkit/verify
|
2026-07-06 09:49:50 +02:00
|
|
|
go tool cover -func=coverage.out | awk '/^total:/{gsub("%","",$3);if($3+0<80){print "coverage "$3"% < 80%";exit 1}print "coverage "$3"%"}'
|
|
|
|
|
|
|
|
|
|
# Format all Go sources.
|
|
|
|
|
fmt:
|
|
|
|
|
gofmt -w .
|
|
|
|
|
|
|
|
|
|
# Run the gasm CLI (pass args after --, e.g. `just run -- lint file.s`).
|
|
|
|
|
run *ARGS:
|
|
|
|
|
go run -ldflags "-X main.version={{version}}" ./cmd/gasm {{ARGS}}
|
|
|
|
|
|
|
|
|
|
# Install the gasm binary into $GOBIN (stamped with the release version).
|
|
|
|
|
install-bin:
|
|
|
|
|
go install -ldflags "-X main.version={{version}}" ./cmd/gasm
|
|
|
|
|
|
|
|
|
|
# Regenerate the architecture instruction tables from the Go toolchain source.
|
|
|
|
|
gen:
|
|
|
|
|
go run _gen/gen.go
|
|
|
|
|
gofmt -w arch/
|
|
|
|
|
|
|
|
|
|
# Remove build artefacts.
|
|
|
|
|
uninstall:
|
|
|
|
|
rm -f coverage.out gasm
|
|
|
|
|
find . -name '*.test' -delete
|