From 7825a4da9b1538ad1c78411c5e92dc29f9b2309c Mon Sep 17 00:00:00 2001 From: Katy248 Date: Wed, 10 Jul 2024 14:46:11 +0300 Subject: [PATCH] Fixed Makefile --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d4709c9..0b41c1c 100644 --- a/Makefile +++ b/Makefile @@ -4,17 +4,19 @@ GIT_VERSION = $(shell git describe --tags ) DESTDIR ?= PREFIX ?= /usr/local BIN := ./$(NAME) -INSTALED_BIN := $(DESTDIR)$(PREFIX)/bin/$(NAME) +INSTALED_BIN := $(DESTDIR)/$(PREFIX)/bin/$(NAME) COMPLETIONS_DIR := ./scripts/completion BASH_COMPLETION := $(COMPLETIONS_DIR)/bash ZSH_COMPLETION := $(COMPLETIONS_DIR)/zsh INSTALLED_BASH_COMPLETION := $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$(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 -$(BIN): check-no-root +$(BIN): go build \ -ldflags="-X 'gitverse.ru/Xpamych/ALR/internal/config.Version=$(GIT_VERSION)'" \ -o $@ @@ -25,7 +27,10 @@ check-no-root: exit 1; \ fi -install: $(INSTALED_BIN) $(INSTALLED_BASH_COMPLETION) $(INSTALLED_ZSH_COMPLETION) +install: \ + $(INSTALED_BIN) \ + $(INSTALLED_BASH_COMPLETION) \ + $(INSTALLED_ZSH_COMPLETION) @echo "Installation done!" $(INSTALED_BIN): $(BIN)