Update Makefile

This commit is contained in:
Santiago Lo Coco 2024-03-17 14:09:10 +01:00
parent 60195aa043
commit b379f3bc79
1 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,8 @@
DESTDIR = /usr/local/bin
SUDOERSDIR = /private/etc/sudoers.d
INSTALL_PATH_CBATTERY = $(DESTDIR)/cbattery
INSTALL_PATH_VISUDO = $(SUDOERSDIR)/cbattery
PREFIX ?= /usr/local
DESTDIR = $(PREFIX)/bin
all: install
@ -10,10 +11,10 @@ install: $(INSTALL_PATH_CBATTERY) $(INSTALL_PATH_VISUDO)
$(INSTALL_PATH_VISUDO): .visudo
@echo "Installing visudo file to $(SUDOERSDIR)"
@if ! test -d "$(SUDOERSDIR)"; then \
mkdir -p "$(SUDOERSDIR)"; \
sudo mkdir -p "$(SUDOERSDIR)"; \
fi
@cp $< $(SUDOERSDIR)/cbattery
@chmod 440 $(SUDOERSDIR)/cbattery
@sudo cp $< $(SUDOERSDIR)/cbattery
@sudo chmod 440 $(SUDOERSDIR)/cbattery
$(INSTALL_PATH_CBATTERY): cbattery
@echo "Installing cbattery to $(DESTDIR)"