mage: build ppc64 binaries

This commit is contained in:
Cadey Ratio 2017-12-02 15:45:56 -08:00
parent 877ea527ab
commit 884cf5a0e2
1 changed files with 12 additions and 13 deletions

25
mage.go
View File

@ -88,22 +88,20 @@ func goBuildPlugin(ctx context.Context, dir, pkgname, fname string) {
qod.Printlnf("built %s for %s", fname, runtime.GOOS)
}
func buildBins(goos string) {
func buildBins(goos, goarch string) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
d := filepath.Join(wd, "./bin")
os.Mkdir(filepath.Join(d, goos), 0777)
os.Mkdir(filepath.Join(d, goos, goarch), 0777)
for _, pkg := range []string{"route-httpagent", "route-cli", "routed"} {
goBuild(ctx, []string{"GOOS=" + goos}, filepath.Join(d, goos), "cmd/"+pkg)
for _, pkg := range []string{"route-httpagent", "route-cli", "routed", "terraform-provider-route"} {
env := []string{"GOOS=" + goos, "GOARCH=" + goarch}
goBuild(ctx, env, filepath.Join(d, goos, goarch), "cmd/"+pkg)
goInstall(ctx, env, "cmd/"+pkg)
if goos == runtime.GOOS {
goInstall(ctx, nil, "cmd/"+pkg)
}
qod.Printlnf("built binary for %s for os %s", pkg, goos)
qod.Printlnf("built binary for %s for %s/%s", pkg, goos, goarch)
}
}
@ -122,23 +120,24 @@ func Docker() {
// Linux builds binaries for linux
func Linux() {
buildBins("linux")
buildBins("linux", "amd64")
buildBins("linux", "ppc64")
Plugin()
}
// Windows builds binaries for windows
func Windows() {
buildBins("windows")
buildBins("windows", "amd64")
}
// Darwin builds binaries for darwin
func Darwin() {
buildBins("darwin")
buildBins("darwin", "amd64")
}
// Build builds the binaries for route and routed.
func Build() {
buildBins(runtime.GOOS)
buildBins(runtime.GOOS, runtime.GOARCH)
if runtime.GOOS == "linux" {
Plugin()