Linkstamp the binaries when building with make.
[mailpopbox.git] / Makefile
1 .PHONY:
2 all: coverage mac linux
3
4 DIRTY=$(shell [[ -z `git status --untracked-files=no --porcelain` ]] || echo "-dirty")
5 GITHASH=$(shell git log --pretty='%H' -1)
6
7 LDFLAG=-ldflags "-X 'main.versionGit=$(GITHASH)$(DIRTY)'"
8
9 coverage:
10 go test -coverprofile ./cover.out ./...
11 go tool cover -html=cover.out -o cover.html
12
13 mac:
14 GOOS=darwin GOARCH=amd64 go build -o mailpopbox-mac-amd64 $(LDFLAG)
15
16 linux:
17 GOOS=linux GOARCH=amd64 go build -o mailpopbox-linux-amd64 $(LDFLAG)