mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-08 21:37:58 -05:00
Add Makefile
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@ gspt
|
|||||||
token.txt
|
token.txt
|
||||||
.fuse*
|
.fuse*
|
||||||
*.jpg
|
*.jpg
|
||||||
|
bin
|
||||||
|
|||||||
43
Makefile
Normal file
43
Makefile
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
COUNT := $(shell git rev-list --count HEAD)
|
||||||
|
SHORT := $(shell git rev-parse --short HEAD)
|
||||||
|
VERSION := $(shell printf "r%s.%s\n" ${COUNT} ${SHORT})
|
||||||
|
DATE := $(shell date +%s)
|
||||||
|
REPO := aditya-K2/gspt
|
||||||
|
GC := go
|
||||||
|
VERBOSE =
|
||||||
|
LDFLAGS := -ldflags="-X github.com/${REPO}/config.Version=${VERSION} -X github.com/${REPO}/config.BuildDate=${DATE}"
|
||||||
|
BUILD := ${GC} build ${LDFLAGS} ${VERBOSE}
|
||||||
|
|
||||||
|
.PHONY: gspt install linux-arm64 linux-amd64 darwin-amd64 darwin-arm64 windows-amd64
|
||||||
|
|
||||||
|
all: linux-amd64 linux-arm64 linux-arm darwin-amd64 darwin-arm64 windows-amd64.exe
|
||||||
|
|
||||||
|
install: gspt
|
||||||
|
install gspt -t "/usr/bin/"
|
||||||
|
|
||||||
|
gspt:
|
||||||
|
${BUILD} -o bin/gspt
|
||||||
|
|
||||||
|
linux-amd64:
|
||||||
|
GOOS=linux GOARCH=amd64 \
|
||||||
|
${BUILD} -o bin/gspt-linux-amd64
|
||||||
|
|
||||||
|
linux-arm64:
|
||||||
|
GOOS=linux GOARCH=arm64 \
|
||||||
|
${BUILD} -o bin/gspt-linux-arm64
|
||||||
|
|
||||||
|
linux-arm:
|
||||||
|
GOOS=linux GOARCH=arm \
|
||||||
|
${BUILD} -o bin/gspt-linux-arm
|
||||||
|
|
||||||
|
darwin-amd64:
|
||||||
|
GOOS=darwin GOARCH=amd64 \
|
||||||
|
${BUILD} -o bin/gspt-darwin-amd64
|
||||||
|
|
||||||
|
darwin-arm64:
|
||||||
|
GOOS=darwin GOARCH=arm64 \
|
||||||
|
${BUILD} -o bin/gspt-darwin-arm64
|
||||||
|
|
||||||
|
windows-amd64.exe:
|
||||||
|
GOOS=windows GOARCH=amd64 \
|
||||||
|
${BUILD} -o bin/gspt-windows-amd64.exe
|
||||||
Reference in New Issue
Block a user