aboutsummaryrefslogtreecommitdiff
path: root/package/hwdata/hwdata.mk
blob: 8d2cfc743812ed57ea9636c6efbcec3e35a59f29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#############################################################
#
# hwdata
#
#############################################################
HWDATA_VERSION:=0.191
HWDATA_SOURCE:=hwdata_$(HWDATA_VERSION).orig.tar.gz
HWDATA_PATCH:=hwdata_$(HWDATA_VERSION)-1.diff.gz
HWDATA_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/h/hwdata/
HWDATA_CAT:=$(ZCAT)
HWDATA_DIR:=$(BUILD_DIR)/hwdata-$(HWDATA_VERSION)
HWDATA_BINARY:=pci.ids
HWDATA_TARGET_BINARY:=usr/share/hwdata/pci.ids

$(DL_DIR)/$(HWDATA_SOURCE):
	 $(WGET) -P $(DL_DIR) $(HWDATA_SITE)/$(HWDATA_SOURCE)

$(DL_DIR)/$(HWDATA_PATCH):
	 $(WGET) -P $(DL_DIR) $(HWDATA_SITE)/$(HWDATA_PATCH)

hwdata-source: $(DL_DIR)/$(HWDATA_SOURCE) $(DL_DIR)/$(HWDATA_PATCH)

$(HWDATA_DIR)/.unpacked: $(DL_DIR)/$(HWDATA_SOURCE) $(DL_DIR)/$(HWDATA_PATCH)
	$(HWDATA_CAT) $(DL_DIR)/$(HWDATA_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(HWDATA_DIR) $(DL_DIR) $(HWDATA_PATCH)
	touch $(HWDATA_DIR)/.unpacked

$(TARGET_DIR)/$(HWDATA_TARGET_BINARY): $(HWDATA_DIR)/.unpacked
	mkdir -p -m 755 $(TARGET_DIR)/usr/share/hwdata
	cp -a $(HWDATA_DIR)/pci.ids $(TARGET_DIR)/usr/share/hwdata
	cp -a $(HWDATA_DIR)/usb.ids $(TARGET_DIR)/usr/share/hwdata
	-touch -c $(TARGET_DIR)/usr/share/hwdata/*

hwdata: uclibc $(TARGET_DIR)/$(HWDATA_TARGET_BINARY)

hwdata-clean:
	rm -rf $(TARGET_DIR)/usr/share/hwdata
	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share

hwdata-dirclean:
	rm -rf $(HWDATA_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_HWDATA),y)
TARGETS+=hwdata
endif