Update Makefile
This commit is contained in:
parent
60195aa043
commit
b379f3bc79
9
Makefile
9
Makefile
|
@ -1,7 +1,8 @@
|
||||||
DESTDIR = /usr/local/bin
|
|
||||||
SUDOERSDIR = /private/etc/sudoers.d
|
SUDOERSDIR = /private/etc/sudoers.d
|
||||||
INSTALL_PATH_CBATTERY = $(DESTDIR)/cbattery
|
INSTALL_PATH_CBATTERY = $(DESTDIR)/cbattery
|
||||||
INSTALL_PATH_VISUDO = $(SUDOERSDIR)/cbattery
|
INSTALL_PATH_VISUDO = $(SUDOERSDIR)/cbattery
|
||||||
|
PREFIX ?= /usr/local
|
||||||
|
DESTDIR = $(PREFIX)/bin
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
|
@ -10,10 +11,10 @@ install: $(INSTALL_PATH_CBATTERY) $(INSTALL_PATH_VISUDO)
|
||||||
$(INSTALL_PATH_VISUDO): .visudo
|
$(INSTALL_PATH_VISUDO): .visudo
|
||||||
@echo "Installing visudo file to $(SUDOERSDIR)"
|
@echo "Installing visudo file to $(SUDOERSDIR)"
|
||||||
@if ! test -d "$(SUDOERSDIR)"; then \
|
@if ! test -d "$(SUDOERSDIR)"; then \
|
||||||
mkdir -p "$(SUDOERSDIR)"; \
|
sudo mkdir -p "$(SUDOERSDIR)"; \
|
||||||
fi
|
fi
|
||||||
@cp $< $(SUDOERSDIR)/cbattery
|
@sudo cp $< $(SUDOERSDIR)/cbattery
|
||||||
@chmod 440 $(SUDOERSDIR)/cbattery
|
@sudo chmod 440 $(SUDOERSDIR)/cbattery
|
||||||
|
|
||||||
$(INSTALL_PATH_CBATTERY): cbattery
|
$(INSTALL_PATH_CBATTERY): cbattery
|
||||||
@echo "Installing cbattery to $(DESTDIR)"
|
@echo "Installing cbattery to $(DESTDIR)"
|
||||||
|
|
Loading…
Reference in New Issue