Clean up the Makefile: add make build, remove superseded targets #73
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Policy: "The Makefile is authoritative documentation for how the repo is
used... If someone checks out the repo and types
make<tab>, they shouldsee every meaningful operation available. A new contributor should be able
to understand the entire development workflow by reading the Makefile."
The current Makefile fails that test in both directions.
Missing. There is no
buildtarget. Policy namesmake buildas anexpected target for building artifacts. The closest thing is a file rule,
bin/mfer: $(SOURCEFILES) mfer/mf.pb.go, which a new contributor will notdiscover.
Superseded cruft still present, all predating the scripts-to-rule-them-all
migration and the current hash-pinned multistage Dockerfile:
vendor.tzst,modcache.tzst,sneak-mfer.$(ARCH).tzst.dockerimage— amanual pre-BuildKit tarball-caching workflow the Dockerfile replaced. The
vendor.tzstrule runsrm -rf vendor, which is a destructive operationsitting in a file nobody reads.
DOCKER_IMAGE_CACHE_DIR := $(HOME)/Library/Caches/Docker/...— macOS-only,referenced nowhere else.
devprereqs— duplicatesscript/bootstrapwith a weaker unpinned installpath (also covered by #68).
$(PROTOC_GEN_GO)atMakefile:35-36— no target depends on it;mfer/mf.pb.go: mfer/mf.protodoes not list it as a prerequisite. Dead.godoc— shells out to macOSopen.ci: test— leftover from before the Gitea workflow calledscript/cibuilddirectly, and it is now actively misleading:make ciruns only tests, not the real CI gate.
fixme— agrepwrapper; harmless but unreferenced by any policy or doc.Definition of done
make buildtarget exists, is documented in the README Entrypointssection, and produces the
mferbinary. It goes through ascript/buildentrypoint like every other target, per scripts-to-rule-them-all — the
Makefile target is a thin shim.
explaining why it survives. Default to deleting.
make<tab>shows only operations that work and that a contributor wouldactually run.
.PHONYwhere appropriate — thecurrent
.PHONYline omits several and listsrun, which has a real fileprerequisite.
make check,make build, anddocker build .all succeed.TODO.mdupdated in the same commit.
Implementation requirements
Dockerfile, every file inscript/,.gitea/workflows/check.yml,README.md,AGENTS.md, andcontrib/usage.sh.grepfor each targetname across the whole repo.
make rundepends on./bin/mferand thebin/build rule; if you changehow the binary is built, keep
make runworking.urfave_cli_no_docsbuild tag. Losing either silently breaksmfer --version, which the release checklist depends on.Dockerfile's build invocation to use the new target inthis PR unless you verify the Docker build still succeeds end to end.
script/buildmust be POSIX sh,set -eu, no bashisms, and locate therepo root the same way the other scripts do.
(closes #73).