From d4ad5ab7d555d660a8469b54df623e46ef36f17b Mon Sep 17 00:00:00 2001 From: Michael Dvorkin Date: Wed, 6 Jan 2016 16:43:18 -0800 Subject: [PATCH] Update Makefile to follow build/install conventions for Go packages --- .gitignore | 1 + Makefile | 20 +++++++++++++++++--- bin/.gitkeep | 0 cmd/{mop.go => mop/main.go} | 0 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 bin/.gitkeep rename cmd/{mop.go => mop/main.go} (100%) diff --git a/.gitignore b/.gitignore index 3883566..70d414a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,6 @@ tmtags # Builds and logs. mop +bin/mop* logs/* diff --git a/Makefile b/Makefile index bd6bebe..a2247dc 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,22 @@ +# Copyright (c) 2013-2016 by Michael Dvorkin. All Rights Reserved. +# Use of this source code is governed by a MIT-style license that can +# be found in the LICENSE file. + +VERSION = 0.2.0 +PACKAGE = github.com/michaeldv/mop/cmd/mop + run: - go run ./cmd/mop.go + go run ./cmd/mop/main.go build: - go build ./cmd/mop.go + go build -x $(PACKAGE) install: - go install github.com/michaeldv/mop/cmd + go install -x $(PACKAGE) + +buildall: + GOOS=darwin GOARCH=amd64 go build $(GOFLAGS) -o ./bin/mop-$(VERSION)-osx-64 $(PACKAGE) + GOOS=freebsd GOARCH=amd64 go build $(GOFLAGS) -o ./bin/mop-$(VERSION)-freebsd-64 $(PACKAGE) + GOOS=linux GOARCH=amd64 go build $(GOFLAGS) -o ./bin/mop-$(VERSION)-linux-64 $(PACKAGE) + GOOS=windows GOARCH=amd64 go build $(GOFLAGS) -o ./bin/mop-$(VERSION)-windows-64.exe $(PACKAGE) + GOOS=windows GOARCH=386 go build $(GOFLAGS) -o ./bin/mop-$(VERSION)-windows-32.exe $(PACKAGE) \ No newline at end of file diff --git a/bin/.gitkeep b/bin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cmd/mop.go b/cmd/mop/main.go similarity index 100% rename from cmd/mop.go rename to cmd/mop/main.go