-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 1.16 KB
/
Makefile
File metadata and controls
47 lines (36 loc) · 1.16 KB
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
45
46
47
SHELL := /bin/bash
# ================================================
# Config
# ================================================
GO:=$(GOROOT)/bin/go
export PATH:=$(GOROOT)/bin:$(PATH)
ENV ?= dev
PROJECT_NAME := transientvariable/hold
COMMIT := $(shell git rev-parse --short HEAD)
BIN_NAME := hold
BUILD_TIMESTAMP := $(date -u +'%Y-%m-%dT%H:%M:%SZ')
BUILD_OUTPUT_DIR := build
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --silent
# ================================================
# Rules
# ================================================
default: all
.PHONY: all
all: clean check build
.PHONY: clean
clean:
@printf "\033[2m→ Cleaning project build output directory: $(BUILD_OUTPUT_DIR)\033[0m\n"
@rm -rf "$(BUILD_OUTPUT_DIR)" 2> /dev/null
.PHONY: check
check:
@printf "\033[2m→ No checks for this repository at this time...\033[0m\n"
.PHONY: build.all
build.all: clean build
.PHONY: build
build:
@printf "\033[2m→ Building application binary...\033[0m\n"
@mkdir -p $(BUILD_OUTPUT_DIR)
@go get -d -v ./...
@go build -installsuffix 'static' -o $(BUILD_OUTPUT_DIR)/$(BIN_NAME) .