add make target to build static binary

This is useful to generate a binary that can be dropped
onto any arbitrary distro, such as CoreOS, without having
to worry about glibc or other dependencies.

Specifically: CoreOS uses glibc, but it does not have a
package manager. It also has a read-only OS (`/usr/`).
Thus I'd like to compile a binary that can be dropped
into CoreOS and have zero dependencies.

* `make build` builds the same as it did before this commit.
* `make all` builds both dynamic and static bins, as expected.

I struggled with a way to DRY this up _and_ avoid diff churn.
In the end, I went with simplicity even though it's not DRY.
This commit is contained in:
Paul Morgan
2016-04-26 00:48:13 +00:00
parent eac3b25dc9
commit 2654384461
2 changed files with 12 additions and 1 deletions

1
.gitignore vendored
View File

@@ -6,4 +6,5 @@ old/
tmp/
*_stringer.go
mgmt
mgmt.static
rpmbuild/