1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-23 09:16:11 +00:00

Update makefile

This commit is contained in:
MatMoul 2017-01-15 05:39:05 +01:00
parent cb93f9c9a0
commit 0435ffa921

View File

@ -3,6 +3,7 @@ CFLAGS=-Wall -O2 -std=gnu++11
LIBUSB_INC?=-I/usr/include/libusb-1.0 LIBUSB_INC?=-I/usr/include/libusb-1.0
LDFLAGS=-lusb-1.0 LDFLAGS=-lusb-1.0
PROGN=g810-led PROGN=g810-led
SYSTEMDDIR?=/usr/lib/systemd
.PHONY: all debug clean install uninstall .PHONY: all debug clean install uninstall
@ -19,33 +20,37 @@ clean:
@rm -rf bin @rm -rf bin
install: install:
@sudo mkdir -p /etc/$(PROGN)/samples @install -m 755 -d \
@sudo cp sample_profiles/* /etc/$(PROGN)/samples $(DESTDIR)/etc/$(PROGN)/samples \
@sudo cp udev/$(PROGN).rules /etc/udev/rules.d $(DESTDIR)/etc/udev/rules.d \
@sudo udevadm control --reload-rules $(DESTDIR)$(SYSTEMDDIR)/system \
@sudo cp bin/$(PROGN) /usr/bin $(DESTDIR)/usr/bin
@sudo test -s /usr/bin/g410-led || sudo ln -s /usr/bin/$(PROGN) /usr/bin/g410-led @cp bin/$(PROGN) $(DESTDIR)/usr/bin
@sudo test -s /usr/bin/g610-led || sudo ln -s /usr/bin/$(PROGN) /usr/bin/g610-led @test -s $(DESTDIR)/usr/bin/g410-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g410-led
@sudo test -s /usr/bin/g910-led || sudo ln -s /usr/bin/$(PROGN) /usr/bin/g910-led @test -s $(DESTDIR)/usr/bin/g610-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g610-led
@sudo test -s /etc/$(PROGN)/profile || sudo cp /etc/$(PROGN)/samples/group_keys /etc/$(PROGN)/profile @test -s $(DESTDIR)/usr/bin/g910-led || ln -s /usr/bin/$(PROGN) $(DESTDIR)/usr/bin/g910-led
@sudo test -s /etc/$(PROGN)/reboot || sudo cp /etc/$(PROGN)/samples/all_off /etc/$(PROGN)/reboot @cp udev/$(PROGN).rules $(DESTDIR)/etc/udev/rules.d
@sudo cp systemd/$(PROGN).service /lib/systemd/system @cp sample_profiles/* $(DESTDIR)/etc/$(PROGN)/samples
@sudo cp systemd/$(PROGN)-reboot.service /lib/systemd/system @test -s $(DESTDIR)/etc/$(PROGN)/profile || cp $(DESTDIR)/etc/$(PROGN)/samples/group_keys $(DESTDIR)/etc/$(PROGN)/profile
@sudo systemctl daemon-reload @test -s $(DESTDIR)/etc/$(PROGN)/reboot || cp $(DESTDIR)/etc/$(PROGN)/samples/all_off $(DESTDIR)/etc/$(PROGN)/reboot
@sudo systemctl start $(PROGN) @cp systemd/$(PROGN).service $(DESTDIR)$(SYSTEMDDIR)/system
@sudo systemctl enable $(PROGN) @cp systemd/$(PROGN)-reboot.service $(DESTDIR)$(SYSTEMDDIR)/system
@sudo systemctl enable $(PROGN)-reboot @udevadm control --reload-rules
@systemctl daemon-reload
@systemctl start $(PROGN)
@systemctl enable $(PROGN)
@systemctl enable $(PROGN)-reboot
uninstall: uninstall:
@sudo systemctl disable $(PROGN) @systemctl disable $(PROGN)
@sudo systemctl disable $(PROGN)-reboot @systemctl disable $(PROGN)-reboot
@sudo rm /lib/systemd/system/$(PROGN).service @rm $(SYSTEMDDIR)/system/$(PROGN).service
@sudo rm /lib/systemd/system/$(PROGN)-reboot.service @rm $(SYSTEMDDIR)/system/$(PROGN)-reboot.service
@sudo systemctl daemon-reload @systemctl daemon-reload
@sudo rm /usr/bin/g410-led @rm /usr/bin/g410-led
@sudo rm /usr/bin/g610-led @rm /usr/bin/g610-led
@sudo rm /usr/bin/g910-led @rm /usr/bin/g910-led
@sudo rm /usr/bin/$(PROGN) @rm /usr/bin/$(PROGN)
@sudo rm -R /etc/$(PROGN) @rm -R /etc/$(PROGN)
@sudo rm /etc/udev/rules.d/$(PROGN).rules @rm /etc/udev/rules.d/$(PROGN).rules
@sudo udevadm control --reload-rules @udevadm control --reload-rules