-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
44 lines (34 loc) · 940 Bytes
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.PHONY: test build format install release
GIT_PATH = github.com/issadarkthing
BIN_NAME = gomu
REPO_NAME = gomu
BIN_DIR := $(CURDIR)/bin
INSTALL_DIR := $${HOME}/.local/bin
VERSION = $(shell git describe --abbrev=0 --tags)
GIT_COMMIT = $(shell git rev-parse HEAD)
BUILD_DATE = $(shell date '+%Y-%m-%d-%H:%M:%S')
GO = go
default: build
test:
@echo === TESTING ===
go test ./...
format:
@echo === FORMATTING ===
go fmt ./...
$(BIN_DIR):
mkdir -p $@
$(INSTALL_DIR):
mkdir -p $@
build: $(BIN_DIR)
@echo === BUILDING ===
${GO} build -ldflags "-X main.VERSION=${VERSION}" -v -o $(BIN_DIR)/$(BIN_NAME)
run: build $(BIN_DIR)
bin/gomu -config ./test/config
install: build $(INSTALL_DIR)
@echo === INSTALLING ===
cp ${BIN_DIR}/${BIN_NAME} ${INSTALL_DIR}/${BIN_NAME}
release: build
@echo === RELEASING ===
mkdir -p dist
tar czf dist/gomu-${VERSION}-amd64.tar.gz bin/${BIN_NAME}
./aur-build.sh