mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 01:06:11 +00:00
Add make install and make uninstall
This commit is contained in:
parent
277e308323
commit
2154dfe45e
25
makefile
25
makefile
@ -4,7 +4,7 @@ LIBUSB_INC?=-I/usr/include/libusb-1.0
|
||||
LDFLAGS=-lusb-1.0
|
||||
PROGN=g810-led
|
||||
|
||||
.PHONY: all debug clean
|
||||
.PHONY: all debug clean install uninstall update
|
||||
|
||||
all: bin/$(PROGN)
|
||||
|
||||
@ -16,5 +16,26 @@ debug: CFLAGS += -g -Wextra -pedantic
|
||||
debug: bin/$(PROGN)
|
||||
|
||||
clean:
|
||||
rm -rf bin
|
||||
@rm -rf bin
|
||||
|
||||
install:
|
||||
@sudo mkdir -p /etc/$(PROGN)/samples
|
||||
@sudo cp sample_profiles/* /etc/$(PROGN)/samples
|
||||
@sudo cp udev/$(PROGN).rules /etc/udev/rules.d
|
||||
@sudo cp bin/$(PROGN) /usr/bin
|
||||
@sudo test -s /etc/$(PROGN)/profile || sudo cp /etc/$(PROGN)/samples/group_keys /etc/$(PROGN)/profile
|
||||
@sudo test -s /etc/$(PROGN)/reboot || sudo cp /etc/$(PROGN)/samples/all_off /etc/$(PROGN)/reboot
|
||||
@sudo cp systemd/$(PROGN).service /usr/lib/systemd/system
|
||||
@sudo cp systemd/$(PROGN)-reboot.service /usr/lib/systemd/system
|
||||
@sudo systemctl start $(PROGN)
|
||||
@sudo systemctl enable $(PROGN)
|
||||
@sudo systemctl enable $(PROGN)-reboot
|
||||
|
||||
uninstall:
|
||||
@sudo systemctl disable $(PROGN)
|
||||
@sudo systemctl disable $(PROGN)-reboot
|
||||
@sudo rm /usr/lib/systemd/system/$(PROGN).service
|
||||
@sudo rm /usr/lib/systemd/system/$(PROGN)-reboot.service
|
||||
@sudo rm /etc/udev/rules.d/$(PROGN).rules
|
||||
@sudo rm /usr/bin/$(PROGN)
|
||||
@sudo rm -R /etc/$(PROGN)
|
||||
|
6
udev/g810-led.rules
Normal file
6
udev/g810-led.rules
Normal file
@ -0,0 +1,6 @@
|
||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c331", MODE="660", GROUP="users"
|
||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c337", MODE="660", GROUP="users"
|
||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c330", MODE="660", GROUP="users"
|
||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c333", MODE="660", GROUP="users"
|
||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c32b", MODE="660", GROUP="users"
|
||||
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c335", MODE="660", GROUP="users"
|
Loading…
Reference in New Issue
Block a user