mirror of
https://github.com/Lekensteyn/ltunify.git
synced 2025-12-08 17:53:23 +00:00
Makefile: add install{,-udevrule} and uninstall
This is supposed to help distro packagers of ltunify.
This commit is contained in:
20
Makefile
20
Makefile
@@ -1,6 +1,14 @@
|
||||
override CFLAGS := -g -O2 -Wall -Wextra -D_FORTIFY_SOURCE=2 -fstack-protector --param ssp-buffer-size=4 $(CFLAGS)
|
||||
# for install-home
|
||||
BINDIR ?= $(HOME)/bin
|
||||
|
||||
# for install and uninstall
|
||||
DESTDIR ?=
|
||||
bindir ?= /usr/local/bin
|
||||
udevrulesdir ?= /etc/udev/rules.d
|
||||
|
||||
udevrule = 42-logitech-unify-permissions.rules
|
||||
|
||||
%: %.c
|
||||
$(CC) $(CFLAGS) -o $(OUTDIR)$@ $<
|
||||
|
||||
@@ -10,9 +18,19 @@ read-dev-usbmon: read-dev-usbmon.c hidraw.c
|
||||
|
||||
ltunify: ltunify.c hidpp20.c
|
||||
|
||||
.PHONY: all clean install-home
|
||||
.PHONY: all clean install-home install install-udevrule uninstall
|
||||
clean:
|
||||
rm -f ltunify read-dev-usbmon hidraw
|
||||
|
||||
install-home: ltunify
|
||||
install -m755 -D ltunify $(BINDIR)/ltunify
|
||||
|
||||
# System-wide installation
|
||||
install: ltunify install-udevrule
|
||||
install -m755 -D ltunify $(DESTDIR)$(bindir)/ltunify
|
||||
|
||||
install-udevrule: udev/$(udevrule)
|
||||
install -m644 -D udev/$(udevrule) $(DESTDIR)$(udevrulesdir)/$(udevrule)
|
||||
|
||||
uninstall:
|
||||
$(RM) $(DESTDIR)$(bindir)/ltunify $(DESTDIR)$(udevrulesdir)/$(udevrule)
|
||||
|
||||
14
README.txt
14
README.txt
@@ -33,7 +33,19 @@ Usage of USB debugger:
|
||||
|
||||
Pairing tool (ltunify)
|
||||
ltunify allows you to pair new devices, unpair existing devices or view
|
||||
information for those devices. Run `ltunify --help` for available options.
|
||||
information for those devices. In order to build the ltunify binary and install
|
||||
it to `$HOME/bin/ltunify`:
|
||||
|
||||
make ltunify
|
||||
make install-home
|
||||
|
||||
If you intend to package ltunify or otherwise install it system-wide with a
|
||||
udevrule, you can use:
|
||||
|
||||
make ltunify
|
||||
make install DESTDIR=$pkgdir bindir=/usr/bin udevrulesdir=/lib/udev/rules.d
|
||||
|
||||
Once installed, run `ltunify --help` for available options.
|
||||
|
||||
Usage of the pairing tool is pretty straight-forward. Example session:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user