yay/Makefile

44 lines
1.4 KiB
Makefile
Raw Normal View History

2016-09-05 02:32:57 +00:00
.PHONY: build doc fmt lint run test vendor_clean vendor_get vendor_update vet
# Prepend our _vendor directory to the system GOPATH
# so that import path resolution will prioritize
# our third party snapshots.
VERSION := $(shell git rev-list --count master)
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}"
GOFILES := $(shell ls *.go | grep -v /vendor/)
2016-12-02 18:22:21 +00:00
PKGNAME=yay
BINARY=./bin/${PKGNAME}
ARCH64="amd64"
ARCH86="386"
2016-09-05 02:32:57 +00:00
default: build
install:
go install -v ${LDFLAGS} ${GO_FILES}
2016-12-02 18:22:21 +00:00
test:
go test ./...
2016-09-05 02:32:57 +00:00
build:
2016-12-02 18:22:21 +00:00
go build -v -o ${BINARY} ${LDFLAGS} ./cmd/yay/
2017-04-10 01:03:07 +00:00
release64:
2016-12-02 18:22:21 +00:00
GOARCH=${ARCH64} go build -v -o ./${PKGNAME}_1.${VERSION}_${ARCH64}/${PKGNAME} ${LDFLAGS} ./cmd/yay/
2016-12-02 21:21:27 +00:00
cp ./LICENSE ./${PKGNAME}_1.${VERSION}_${ARCH64}/
cp ./yay.fish ./${PKGNAME}_1.${VERSION}_${ARCH64}/
cp ./zsh-completion ./${PKGNAME}_1.${VERSION}_${ARCH64}/
cp ./bash-completion ./${PKGNAME}_1.${VERSION}_${ARCH64}/
2016-12-02 18:22:21 +00:00
tar -czvf ${PKGNAME}_1.${VERSION}_${ARCH64}.tar.gz ${PKGNAME}_1.${VERSION}_${ARCH64}
2017-04-10 01:03:07 +00:00
release86:
GOARCH=${ARCH86} go build -v -o ./${PKGNAME}_1.${VERSION}_${ARCH86}/${PKGNAME} ${LDFLAGS} ./cmd/yay/
cp ./LICENSE ./${PKGNAME}_1.${VERSION}_${ARCH86}/
cp ./yay.fish ./${PKGNAME}_1.${VERSION}_${ARCH86}/
cp ./zsh-completion ./${PKGNAME}_1.${VERSION}_${ARCH86}/
cp ./bash-completion ./${PKGNAME}_1.${VERSION}_${ARCH86}/
tar -czvf ${PKGNAME}_1.${VERSION}_${ARCH86}.tar.gz ${PKGNAME}_1.${VERSION}_${ARCH86}
2016-12-02 18:22:21 +00:00
run:
build
2016-09-05 02:32:57 +00:00
${BINARY}
clean:
go clean
2016-12-02 18:22:21 +00:00
rm -r ./${PKGNAME}_1*
2016-09-05 02:32:57 +00:00