2018-02-17 19:25:43 +01:00
|
|
|
.PHONY: all default install test build release clean
|
|
|
|
VERSION := $(shell git rev-list --count master)
|
2018-02-27 02:51:51 +01:00
|
|
|
LDFLAGS=-ldflags '-s -w -X main.version=3.${VERSION}'
|
2016-10-05 18:04:16 +02:00
|
|
|
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
|
|
|
|
|
2018-02-27 02:51:51 +01:00
|
|
|
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
|
|
|
|
|
2016-10-05 18:04:16 +02:00
|
|
|
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
|
|
|
|