1 PROG
= usb-modeswitch-data
4 PREFIX
= $(DESTDIR
)/usr
5 ETCDIR
= $(DESTDIR
)/etc
6 RULESDIR
= $(DESTDIR
)/lib
/udev
/rules.d
11 all: 40-usb_modeswitch.rules
14 $(RM
) 40-usb_modeswitch.rules
16 install: all files-install db-install rules-reload
18 install-packed
: files-install db-install-packed rules-reload
21 install -d
$(PREFIX
)/share
/usb_modeswitch
22 install -d
$(ETCDIR
)/usb_modeswitch.d
23 install -D
--mode
=644 40-usb_modeswitch.rules
$(RULESDIR
)/40-usb_modeswitch.rules
25 40-usb_modeswitch.rules
:
28 db-install
: files-install
29 install --mode
=644 -t
$(PREFIX
)/share
/usb_modeswitch .
/usb_modeswitch.d
/*
32 @
# Create a compressed tar without gzip timestamp, so tar.gz
33 @
# differs only if content is different
34 cd .
/usb_modeswitch.d
; tar -cf ..
/configPack.
tar *
35 gzip
-f9n .
/configPack.
tar
36 install --mode
=644 -t
$(PREFIX
)/share
/usb_modeswitch .
/configPack.
tar.gz
37 rm -f .
/configPack.
tar.gz
40 @if
[ -f
$(ETCDIR
)/issue
]; then \
41 UDEVADM
=`which udevadm 2>/dev/null`; \
42 if
[ "x$$UDEVADM" != "x" ]; then \
43 UDEVADM_VER
=`$$UDEVADM -V 2>/dev/null`; \
44 if
[ -z
$$UDEVADM_VER ]; then \
45 UDEVADM_VER
=`$$UDEVADM --version 2>/dev/null`; \
47 if
[ $$UDEVADM_VER -gt
127 ]; then \
48 $$UDEVADM control
--reload-rules
; \
50 $$UDEVADM control
--reload_rules
; \
52 elif
[ `which udevcontrol 2>/dev/null` ]; then \
53 `which udevcontrol` reload_rules
; \
57 uninstall: files-uninstall rules-reload
60 $(RM
) $(RULESDIR
)/40-usb_modeswitch.rules
61 $(RM
) -R
$(PREFIX
)/share
/usb_modeswitch
63 .PHONY
: clean install uninstall