10 PKG_CONFIG ?= pkg-config
18 COMPRESS_FILES-$(PCI) += pci.ids.gz
19 COMPRESS_FILES-$(USB) += usb.ids.gz
22 DATA_FILES-$(GZIP) += $(COMPRESS_FILES-yes)
23 DATA_FILES-$(NET) += oui.txt iab.txt
24 DATA_FILES-$(PCI) += pci.ids
25 DATA_FILES-$(USB) += usb.ids
28 ALL_TARGETS-$(GZIP) += $(COMPRESS_FILES-yes)
29 ALL_TARGETS-$(UDEV) += udev-hwdb
31 INSTALL_TARGETS-yes = install-base
32 INSTALL_TARGETS-$(UDEV) += install-hwdb
34 all: $(ALL_TARGETS-yes)
36 install: $(INSTALL_TARGETS-yes)
39 $(Q)curl -z pci.ids -o pci.ids -R http://pci-ids.ucw.cz/v2.2/pci.ids
40 $(Q)curl -z usb.ids -o usb.ids -R http://www.linux-usb.org/usb.ids
41 $(Q)curl -z oui.txt -o oui.txt -R http://standards.ieee.org/develop/regauth/oui/oui.txt
42 $(Q)curl -z iab.txt -o iab.txt -R http://standards.ieee.org/develop/regauth/iab/iab.txt
43 $(Q)curl -z sdio.ids -o sdio.ids -R http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/sdio.ids
44 $(Q)curl -z udev/20-acpi-vendor.hwdb -o udev/20-acpi-vendor.hwdb -R http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/20-acpi-vendor.hwdb
45 $(Q)curl -z udev/20-bluetooth-vendor-product.hwdb -o udev/20-bluetooth-vendor-product.hwdb -R http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/20-bluetooth-vendor-product.hwdb
46 $(Q)curl -z udev/20-net-ifname.hwdb -o udev/20-net-ifname.hwdb -R http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/20-net-ifname.hwdb
47 $(Q)curl -z udev/60-keyboard.hwdb -o udev/60-keyboard.hwdb -R http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/60-keyboard.hwdb
48 $(Q)curl -z udev-hwdb-update.pl -o udev-hwdb-update.pl -R http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/ids-update.pl
51 PV ?= $(shell ( awk '$$2 == "Date:" { print $$3; nextfile }' pci.ids usb.ids; git log --format=format:%ci -1 -- oui.txt udev/20-acpi-vendor.hwdb udev/20-bluetooth-vendor-product.hwdb udev/20-net-ifname.hwdb udev/60-keyboard.hwdb udev-hwdb-update.pl | cut -d ' ' -f1; ) | sort | tail -n 1 | tr -d -)
58 perl ./udev-hwdb-update.pl && mv *.hwdb udev/
60 compress: pci.ids.gz usb.ids.gz
65 MISCDIR=/usr/share/misc
66 HWDBDIR=$(shell $(PKG_CONFIG) --variable=udevdir udev)/hwdb.d
67 DOCDIR=/usr/share/doc/hwids
69 install-base: $(DATA_FILES-yes)
70 mkdir -p $(DESTDIR)$(DOCDIR)
71 install -p -m 644 README.md $(DESTDIR)$(DOCDIR)
72 ifneq ($(strip $(DATA_FILES-yes)),)
73 mkdir -p $(DESTDIR)$(MISCDIR)
74 install -p -m 644 $(DATA_FILES-yes) $(DESTDIR)$(MISCDIR)
78 mkdir -p $(DESTDIR)$(HWDBDIR)
79 install -p -m 644 udev/*.hwdb $(DESTDIR)$(HWDBDIR)
80 udevadm hwdb --root $(DESTDIR) --update