yay/Makefile

32 lines
767 B
Makefile
Raw Normal View History

2016-09-05 04:32:57 +02:00
.PHONY: build doc fmt lint run test vendor_clean vendor_get vendor_update vet
VERSION := $(shell git rev-list --count master)
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}"
GOFILES := $(shell ls *.go | grep -v /vendor/)
2017-07-04 19:54:03 +02:00
ARCH=$(shell uname -m)
2016-12-02 19:22:21 +01:00
PKGNAME=yay
2017-07-04 19:54:03 +02:00
OUTPUT="${PKGNAME}_2.${VERSION}_${ARCH}/"
PACKAGE="${PKGNAME}_2.${VERSION}_${ARCH}"
2016-09-05 04:32:57 +02:00
default: build
install:
go install -v ${LDFLAGS} ${GO_FILES}
2016-12-02 19:22:21 +01:00
test:
go test ./...
2016-09-05 04:32:57 +02:00
build:
2017-07-04 19:54:03 +02: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 04:32:57 +02:00
clean:
go clean
2017-07-04 19:54:03 +02:00
rm -r ./${PKGNAME}_*
2016-09-05 04:32:57 +02:00