This repository was archived by the owner on Jul 30, 2021. It is now read-only.
Commit dbf0b6a
Makefile: Use 'go install ...' for the install target (#949)
GOBIN (documented in [1]) defaults to DIR/bin, but it's a configurable
variable in its own right. The old logic was just looking at GOPATH,
though, and not respecting GOBIN.
This commit updates our install target to lean on Go's build caching
(instead of using Make's dependency trees) to ensure a fresh-enough
build lands in the appropriate directory. This approach relies on Go
1.10+ to avoid [2], but we've required Go 1.10+ since b859ebf
(Documentation/development: Bump minimum Go version to 1.10,
2018-04-03, #955).
For the build documentation, I've switched to 'go env GOPATH' to get
the (platform-specific [1]) default value when the environment
variable is not set. And I've used cut [3] (instead of the awk [4]
the Makefile used to use) to pull out the first component of GOPATH.
Both are in POSIX, but cut is a simpler tool for this particular
problem.
[1]: https://golang.org/cmd/go/#hdr-GOPATH_environment_variable
[2]: golang/go#18981
[3]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cut.html
[4]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html1 parent 5f286e9 commit dbf0b6a
2 files changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
0 commit comments