Update Makefile to reflect the move to a go module. #437
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (check at least one)
The PR fulfills these requirements:
If adding a new feature, the PR's description includes:
Other information:
Since Hound is now a proper Go module, we can avoid a lot of the complexity of setting up the
GOPATH
that we used to have to deal with. This updates theMakefile
so thatGOPATH
hijinks is no longer required to build locally. The one caveat is thathoundd
andhound
will be built into.build/bin
instead of$GOPATH/bin
.A few other changes explained:
Why tools/tools.go?
A go module should explicitly reference its dependencies somewhere.
go mod tidy
is often used to cull dependencies that are no longer needed in a go module. This poses a problem for dependencies that are build related as they are only referenced in the build system. A convention that is often used, and which I'm using here, is to add an explicit code reference to those dependencies in a package that is not actually reachable from themain
module ... but tells tools likego mod tidy
that the dependency is used.Why update the node_modules rule to node_modules/build?
Since I created this
Makefile
, I found that make targets that reference a directory are unreliable. Make often believes they have been invalidated when they haven't. It seems to be best practice to not have a directory as a target in gnu make because of differences in the way mtime is updated for directories. So I've started making all mynode_modules
make targets point to a file within thenode_modules
directory.