-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (26 loc) · 770 Bytes
/
Makefile
File metadata and controls
31 lines (26 loc) · 770 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
BINARY_NAME = compose-telepresence
BINARY_DIR = bin
HOME_BIN_DIR = $(HOME)/bin
VERSION = $(shell git describe --tags --always)
GIT_COMMIT = $(shell git rev-parse --short HEAD)
LDFLAGS = -ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT)"
.PHONY: all
all: build
.PHONY: build
build:
mkdir -p $(BINARY_DIR)
go build $(LDFLAGS) -o $(BINARY_DIR)/$(BINARY_NAME)
.PHONY: install
install: build
mkdir -p $(HOME_BIN_DIR)
cp $(BINARY_DIR)/$(BINARY_NAME) $(HOME_BIN_DIR)/
.PHONY: clean
clean:
rm -rf $(BINARY_DIR)
rm -f $(HOME_BIN_DIR)/$(BINARY_NAME)
.PHONY: help
help:
@echo "Available targets:"
@echo " build - Build the binary in ./bin"
@echo " install - Install the binary to ~/bin"
@echo " clean - Remove the binary and bin directory"