8 ms·
That is a common Makefile design pattern. It allows you to call "make GOCMD=path/to/custom/prerelease/go" to run with an alternative go version, for instance. (
by cesarb 9y ago
That is a common Makefile design pattern. It allows you to call "make GOCMD=path/to/custom/prerelease/go" to run with an alternative go version, for instance. (But I agree, the other variables seem overkill.)
- iambvk 9y agoDon't we need to use "GOCMD ?= ..." in the makefile to allow overridding GOCMD from command line?
- wruza 9y agoDepends on use case. There is no religion, make is just a tool for your needs. Your experience should dictate. Mechanism, not policy — the good old and mostly hyped-out principle.
- jaytaylor 9y agoYes, good catch. The `?=' operator will only define the variable if it doesn't exist (and thus allows overriding via: GOCMD=/foo/bar/baz make