yay/Makefile

32 lines
686 B
Makefile
Raw Normal View History

2018-02-17 18:25:43 +00:00
.PHONY: all default install test build release clean
VERSION := 5.$(shell git rev-list --count master)
LDFLAGS=-ldflags '-s -w -X main.version=${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
PACKAGE=${PKGNAME}_${VERSION}_${ARCH}
2016-09-05 02:32:57 +00:00
default: build
2018-02-17 18:25:43 +00:00
all: clean build release package
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:
2018-02-17 18:25:43 +00:00
go build -v ${LDFLAGS}
2017-07-04 17:54:03 +00:00
release:
2018-02-17 18:25:43 +00:00
mkdir ${PACKAGE}
cp ./yay ${PACKAGE}/
cp ./doc/yay.8 ${PACKAGE}/
cp ./completions/zsh ${PACKAGE}/
cp ./completions/fish ${PACKAGE}/
cp ./completions/bash ${PACKAGE}/
2018-02-17 18:25:43 +00:00
package:
2017-07-04 17:54:03 +00:00
tar -czvf ${PACKAGE}.tar.gz ${PACKAGE}
2016-09-05 02:32:57 +00:00
clean:
2018-02-17 18:25:43 +00:00
-rm -rf ${PKGNAME}_*
2016-09-05 02:32:57 +00:00