Add udev's hwdb support straight into hwids.
[oweals/hwids.git] / Makefile
1 # can be replaced with `wget -q -O -` if you want
2 ifeq "$(V)" "0"
3   HTTPCAT = curl -s
4   STATUS = git status -s
5   Q=@
6 else
7   HTTPCAT = curl
8   STATUS = git status
9   Q=
10 endif
11
12 fetch:
13         $(Q)$(HTTPCAT) http://pci-ids.ucw.cz/v2.2/pci.ids.bz2 | bzcat > pci.ids
14         $(Q)$(HTTPCAT) http://www.linux-usb.org/usb.ids.bz2 | bzcat > usb.ids
15         $(Q)$(HTTPCAT) http://standards.ieee.org/develop/regauth/oui/oui.txt > oui.txt
16         $(Q)$(HTTPCAT) http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/20-acpi-vendor.hwdb > udev/20-acpi-vendor.hwdb
17         $(Q)$(HTTPCAT) http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/ids-update.pl > udev-hwdb-update.pl
18         $(Q)$(STATUS)
19
20 PV ?= $(shell ( awk '$$2 == "Date:" { print $$3; nextfile }' pci.ids usb.ids; git log --format=format:%ci -1 -- oui.txt hwdb/20-acpi-vendor.hwdb udev-hwdb-update.pl | cut -d ' ' -f1; ) | sort | tail -n 1 | tr -d -)
21 P = hwids-$(PV)
22
23 tag:
24         git tag $(P)
25
26 udev-hwdb:
27         perl ./udev-hwdb-update.pl && mv *.hwdb udev/