A thing I don't like with my current Makefile setup is that make build traverses the subdirectories and then it runs go build everywhere, and this should really only do something if the dependencies have changed, but it actually runs the linker or at least touches the executable, so this updates the mtime of every program. To do better, the makefiles need to have the actual dependencies of the inputs (usually go.mod *.go */*.go ../go-utils/*/*.go though in some cases there are no subdirs and sometimes there may be more things).
What might work here is for go-rules.mk to take a variable SRCDEPS that is a list of dependencies and will make build depend on those.
Might update SUBDIRS to always name all subdirs where relevant, since go test will run go vet even if there are no tests, and this is a boon.
A thing I don't like with my current Makefile setup is that
make build
traverses the subdirectories and then it runsgo build
everywhere, and this should really only do something if the dependencies have changed, but it actually runs the linker or at least touches the executable, so this updates the mtime of every program. To do better, the makefiles need to have the actual dependencies of the inputs (usuallygo.mod *.go */*.go ../go-utils/*/*.go
though in some cases there are no subdirs and sometimes there may be more things).What might work here is for go-rules.mk to take a variable SRCDEPS that is a list of dependencies and will make
build
depend on those.Might update SUBDIRS to always name all subdirs where relevant, since
go test
will rungo vet
even if there are no tests, and this is a boon.