-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (24 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
MODNAME := github.com/wneessen/arrgo
SPACE := $(null) $(null)
CURVER := 0.0.1-DEV
CURARCH := $(shell uname -m | tr 'A-Z' 'a-z')
CUROS := $(shell uname -s | tr 'A-Z' 'a-z')
BUILDARCH := $(CUROS)_$(CURARCH)
BUILDDIR := ./bin
TZ := UTC
BUILDVER := -X github.com/wneessen/arrgo/bot.Version=$(CURVER)
CURUSER := $(shell whoami)
BUILDUSER := -X github.com/wneessen/arrgo/version.BuildUser=$(subst $(SPACE),_,$(CURUSER))
CURDATE := $(shell date +'%Y-%m-%d %H:%M:%S')
TARGETS := clean build
all: $(TARGETS)
test:
go test $(MODNAME)
dev:
@/usr/bin/env CGO_ENABLED=0 go run -ldflags="-s -w $(BUILDVER)" $(MODNAME)/cmd/arrgo -c ./arrgo.toml
dev-firstrun:
@/usr/bin/env CGO_ENABLED=0 go run -ldflags="-s -w $(BUILDVER)" $(MODNAME)/cmd/arrgo -c ./arrgo.toml -firstrun
dev-migrate:
@/usr/bin/env CGO_ENABLED=0 go run -ldflags="-s -w $(BUILDVER)" $(MODNAME)/cmd/arrgo -c ./arrgo.toml -migrate
dev-downgrade:
@/usr/bin/env CGO_ENABLED=0 go run -ldflags="-s -w $(BUILDVER)" $(MODNAME)/cmd/arrgo -c ./arrgo.toml -downgrade