-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 951 Bytes
/
Makefile
File metadata and controls
36 lines (29 loc) · 951 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
# Makefile for secr-cli
BINARY := secr-cli
INSTALL_PATH := /usr/local/bin
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-s -w -X secr-cli/cmd.version=$(VERSION)"
.PHONY: build install uninstall test clean help
build:
go build $(LDFLAGS) -o $(BINARY) .
install: build
@echo "Installing $(BINARY) to $(INSTALL_PATH)"
@mkdir -p $(INSTALL_PATH)
@mv $(BINARY) $(INSTALL_PATH)
@chmod +x $(INSTALL_PATH)/$(BINARY)
@echo "Installed. Run '$(BINARY) --help' to get started."
uninstall:
@echo "Removing $(INSTALL_PATH)/$(BINARY)"
@rm -f $(INSTALL_PATH)/$(BINARY)
@echo "Uninstalled."
test:
go test ./... -v
clean:
rm -f $(BINARY)
help:
@echo "Available targets:"
@echo " build - Compile the binary"
@echo " install - Install to $(INSTALL_PATH)"
@echo " uninstall - Remove from system"
@echo " test - Run test suite"
@echo " clean - Remove build artifacts"