yay/Makefile

32 lines
674 B
Makefile
Raw Normal View History

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