Makefile: Make it easier to re-generate everything #555
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.
When I start looking at contributing to a project, one of the first things I try to answer is "how do I re-build/generate everything that is generated; am I actually able to re-build this?" This PR aims to lower that bar.
make check_generated
to check all generated files, not justREADME.md
make gen
,make readme
,make update_deps
, andmake assets
into a singlemake generate
make clean
to remove non-commited (.gitignore
d) files that the Makefile generatesmake maintainer-clean
to remove committed files that the Makefile generatesThis mostly aims to document how everything was generated, and the steps necessary to re-generate the same files verbatim; the goal is mostly to figure out how to reproduce the files as they currently are.
To re-generate just an individual file, like
README.md
, you can justmake FILENAME
;make README.md
will work as expected.The Makefile now does more work; it downloads the "Dracula" iTerm2 theme for generating
demo.svg
, it installs the correct version ofmockgen
for generatinglog_mock.go
, et cetera. All of these "extra" things it puts in a.gitignored
directory calledtools/
. I tried to keep the Makefile readable and understandable, though.I rolled back the version of
github.com/golang/mock
from v1.1.1 to v1.0.0, since that's the version used to generatelog_mock.go
, and mixing versions ofmockgen
outputs vs mock libraries seemed unwise.I adjusted the test suite to work with
GO111MODULE=on
, which the Makefile sets.