yay/Makefile

32 lines
771 B
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
2018-02-17 18:02:50 +00:00
VERSION := "$(shell git rev-list --count master)"
LDFLAGS=-ldflags "-s -w -X main.version=2.${VERSION}"
GOFILES := $(shell ls *.go | grep -v /vendor/)
2017-07-04 17:54:03 +00:00
ARCH=$(shell uname -m)
2016-12-02 18:22:21 +00:00
PKGNAME=yay
2017-07-04 17:54:03 +00:00
OUTPUT="${PKGNAME}_2.${VERSION}_${ARCH}/"
PACKAGE="${PKGNAME}_2.${VERSION}_${ARCH}"
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:
2017-07-04 17:54:03 +00:00
go build -v -o ${OUTPUT}/${PKGNAME} ${LDFLAGS}
release:
GOARCH=${ARCH64} go build -v -o ${OUTPUT}/${PKGNAME} ${LDFLAGS}
cp ./yay.8 ${OUTPUT}
cp ./zsh-completion ${OUTPUT}
cp ./yay.fish ${OUTPUT}
cp ./bash-completion ${OUTPUT}
tar -czvf ${PACKAGE}.tar.gz ${PACKAGE}
rm -r ${OUTPUT}
2016-09-05 02:32:57 +00:00
clean:
go clean
2017-07-04 17:54:03 +00:00
rm -r ./${PKGNAME}_*
2016-09-05 02:32:57 +00:00