Update makefile to handle tagging of oui.txt.
[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)$(STATUS)
17
18 PV ?= $(shell ( awk '$$2 == "Date:" { print $$3; nextfile }' pci.ids usb.ids; git log --format=format:%ci -1 -- oui.txt | cut -d ' ' -f1; ) | sort | tail -n 1 | tr -d -)
19 P = hwids-$(PV)
20
21 tag:
22         git tag $(P)