-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 720 Bytes
/
Makefile
File metadata and controls
29 lines (23 loc) · 720 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
BINARY := git-agent
OUT := bin/$(BINARY)
PREFIX ?= ~/.local
BINDIR ?= $(PREFIX)/bin
XDG_CONFIG_HOME ?= $(HOME)/.config
FISH_CONFIG_DIR ?= $(XDG_CONFIG_HOME)/fish
FISH_COMPLETIONS_DIR ?= $(FISH_CONFIG_DIR)/completions
FISH_COMPLETION := completions/$(BINARY).fish
.PHONY: all build test install clean
all: build
build:
go build -o $(OUT) -ldflags='-s -w' ./cmd/git-agent
test:
go test ./...
install: build
install -d $(DESTDIR)$(BINDIR)
install -m 0755 $(OUT) $(DESTDIR)$(BINDIR)/$(BINARY)
@if [ -d "$(DESTDIR)$(FISH_CONFIG_DIR)" ]; then \
install -d "$(DESTDIR)$(FISH_COMPLETIONS_DIR)"; \
install -m 0644 "$(FISH_COMPLETION)" "$(DESTDIR)$(FISH_COMPLETIONS_DIR)/$(BINARY).fish"; \
fi
clean:
rm -f $(OUT)