0
0
Fork 0
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:
Katy248 2024-07-10 14:46:11 +03:00
parent 0d3363bcaf
commit 7825a4da9b

View file

@ -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)