Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rebuilding using make #23

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export GO111MODULE=on
VERSION="$(shell git describe --tags --candidates=1 --dirty)+envato"
FLAGS=-X main.Version=$(VERSION) -s -w
SOURCES=$(wildcard *.go iamy/*.go)

# To create a new release:
# $ git tag vx.x.x
Expand All @@ -14,25 +15,27 @@ FLAGS=-X main.Version=$(VERSION) -s -w

release: bin/iamy-linux-amd64 bin/iamy-darwin-amd64 bin/iamy-windows-386.exe bin/iamy-darwin-arm64 bin/iamy-freebsd-amd64

bin/iamy-darwin-arm64:
bin/iamy-darwin-arm64: $(SOURCES)
@mkdir -p bin
GOOS=darwin GOARCH=arm64 go build -o $@ -ldflags="$(FLAGS)" .

bin/iamy-linux-amd64:
bin/iamy-linux-amd64: $(SOURCES)
@mkdir -p bin
GOOS=linux GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" .

bin/iamy-darwin-amd64:
bin/iamy-darwin-amd64: $(SOURCES)
@mkdir -p bin
GOOS=darwin GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" .

bin/iamy-windows-386.exe:
bin/iamy-windows-386.exe: $(SOURCES)
@mkdir -p bin
GOOS=windows GOARCH=386 go build -o $@ -ldflags="$(FLAGS)" .

bin/iamy-freebsd-amd64:
bin/iamy-freebsd-amd64: $(SOURCES)
@mkdir -p bin
GOOS=freebsd GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" .

clean:
rm -f bin/*

.PHONY: clean release