werc/Makefile
2016-03-20 14:55:18 -07:00

17 lines
558 B
Makefile

P=gowerc
SRC=bitbucket.org
USER?=mischief
GO_VERSION=1.6
all: $(USER)/$(P)
$(USER)/$(P): bin/$(P)
docker build -t "$(USER)/$(P):latest" .
bin/$(P): *.go
docker run --rm -v ${PWD}:/go/src/$(SRC)/$(USER)/$(P) golang:${GO_VERSION} /bin/bash -c "go list -f '{{range .Imports}}{{printf \"%s\n\" .}}{{end}}' $(SRC)/$(USER)/$(P) | xargs go get -d; CGO_ENABLED=0 go build -v -installsuffix cgo -o /go/src/$(SRC)/$(USER)/$(P)/bin/$(P) $(SRC)/$(USER)/$(P)"
clean:
docker run --rm -v ${PWD}:/opt busybox rm -f /opt/bin/$(P)
docker rmi -f "$(USER)/$(P):latest"