-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 1014 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (31 loc) · 1014 Bytes
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
31
32
33
34
35
36
37
38
39
40
GIT ?= git
GO ?= go
COMMIT := $(shell $(GIT) rev-parse HEAD)
VERSION ?= $(shell $(GIT) describe --abbrev=0 --tags 2>/dev/null)
BUILD_TIME := $(shell LANG=en_US date +"%F_%T_%z")
TARGET := gitlab.com/NagByte/Palette
LD_FLAGS := -X $(TARGET)/common.Version=$(VERSION) -X $(TARGET)/common.BuildTime=$(BUILD_TIME)
FORMAT := '{{ join .Deps " " }}'
.PHONY: help clean dependencies update kill run pull deploy
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " Palette to build the main binary for current platform"
@echo " clean to remove generated files"
@echo " kill to stop service"
@echo " run to start service"
@echo " deploy to clone and start"
clean:
rm -f Palette
dependencies:
$(GO) get -v ./...
update:
$(GO) get -t -v -u ./...
Palette: dependencies
$(GO) build -o="Palette" -ldflags="$(LD_FLAGS)" $(TARGET)
kill:
pkill Palette || ``
pull:
$(GIT) pull origin master
run: Palette
./Palette serve 2>> log.txt &
deploy: kill clean pull run