mirror of
https://gitea.plemya-x.ru/Plemya-x/ALR.git
synced 2025-01-10 17:26:45 +00:00
Fixed Makefile
This commit is contained in:
parent
0d3363bcaf
commit
7825a4da9b
1 changed files with 9 additions and 4 deletions
13
Makefile
13
Makefile
|
@ -4,17 +4,19 @@ GIT_VERSION = $(shell git describe --tags )
|
||||||
DESTDIR ?=
|
DESTDIR ?=
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
BIN := ./$(NAME)
|
BIN := ./$(NAME)
|
||||||
INSTALED_BIN := $(DESTDIR)$(PREFIX)/bin/$(NAME)
|
INSTALED_BIN := $(DESTDIR)/$(PREFIX)/bin/$(NAME)
|
||||||
COMPLETIONS_DIR := ./scripts/completion
|
COMPLETIONS_DIR := ./scripts/completion
|
||||||
BASH_COMPLETION := $(COMPLETIONS_DIR)/bash
|
BASH_COMPLETION := $(COMPLETIONS_DIR)/bash
|
||||||
ZSH_COMPLETION := $(COMPLETIONS_DIR)/zsh
|
ZSH_COMPLETION := $(COMPLETIONS_DIR)/zsh
|
||||||
INSTALLED_BASH_COMPLETION := $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$(NAME)
|
INSTALLED_BASH_COMPLETION := $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$(NAME)
|
||||||
INSTALLED_ZSH_COMPLETION := $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_$(NAME)
|
INSTALLED_ZSH_COMPLETION := $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_$(NAME)
|
||||||
|
|
||||||
.PHONY: install clean clear uninstall check-no-root
|
.PHONY: build install clean clear uninstall check-no-root
|
||||||
|
|
||||||
|
build: check-no-root $(BIN)
|
||||||
|
|
||||||
export CGO_ENABLED := 0
|
export CGO_ENABLED := 0
|
||||||
$(BIN): check-no-root
|
$(BIN):
|
||||||
go build \
|
go build \
|
||||||
-ldflags="-X 'gitverse.ru/Xpamych/ALR/internal/config.Version=$(GIT_VERSION)'" \
|
-ldflags="-X 'gitverse.ru/Xpamych/ALR/internal/config.Version=$(GIT_VERSION)'" \
|
||||||
-o $@
|
-o $@
|
||||||
|
@ -25,7 +27,10 @@ check-no-root:
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install: $(INSTALED_BIN) $(INSTALLED_BASH_COMPLETION) $(INSTALLED_ZSH_COMPLETION)
|
install: \
|
||||||
|
$(INSTALED_BIN) \
|
||||||
|
$(INSTALLED_BASH_COMPLETION) \
|
||||||
|
$(INSTALLED_ZSH_COMPLETION)
|
||||||
@echo "Installation done!"
|
@echo "Installation done!"
|
||||||
|
|
||||||
$(INSTALED_BIN): $(BIN)
|
$(INSTALED_BIN): $(BIN)
|
||||||
|
|
Loading…
Reference in a new issue