Makefile: thin shims only, add make build (closes #73)
check / check (push) Failing after 2s
check / check (push) Failing after 2s
The Makefile is now one shim per script/ entrypoint, in the order of the canonical model Makefile, plus build, generate and fuzz. The new script/build writes bin/mfer with the urfave_cli_no_docs tag and the git describe revision that script/docker stamps. script/generate now adds the Go bin directory to PATH itself, and the Docker lint stage calls script/gofumpt --check directly. Removed: the tarball-caching rules and their ignore entries, godoc, ci, fixme, clean, run, default, fmt-check-go, fmt-check-md, and bin/gitrev.sh, which only the Makefile called. Model: opus-5-5
This commit was merged in pull request #152.
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# script/build: build the mfer binary into bin/mfer, stamped with the
|
||||
# revision `mfer version` prints, derived as script/docker derives it.
|
||||
set -eu
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
# Own line: a failing command substitution inside an argument does
|
||||
# not trip `set -e`, so the inline form degrades silently to an
|
||||
# empty constant.
|
||||
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
|
||||
[ -n "$version" ] || version="unknown"
|
||||
go build -tags urfave_cli_no_docs \
|
||||
-ldflags "-X main.Gitrev=$version" \
|
||||
-o bin/mfer ./cmd/mfer
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -40,6 +40,9 @@ sha256() {
|
||||
|
||||
main() {
|
||||
cd "$ROOT/mfer"
|
||||
# `go install` puts protoc-gen-go in $(go env GOPATH)/bin, which is
|
||||
# often not on PATH.
|
||||
PATH="$PATH:$(go env GOPATH)/bin"
|
||||
require_version protoc "libprotoc $PROTOC_VERSION"
|
||||
require_version protoc-gen-go "protoc-gen-go $PROTOC_GEN_GO_VERSION"
|
||||
# Hashed before regenerating, so a missing hash tool stops the script
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
# Takes exactly one mode argument, --write or --check, and runs the same
|
||||
# gofumpt version over the same files in both modes. script/fmt and
|
||||
# script/fmt-check both go through here, and so does the Docker lint
|
||||
# stage (make fmt-check-go), so what gets formatted and what gets
|
||||
# verified cannot drift apart.
|
||||
# stage, so what gets formatted and what gets verified cannot drift
|
||||
# apart.
|
||||
set -eu
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
|
||||
Reference in New Issue
Block a user