2
1

pciutils.mk 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #############################################################
  2. #
  3. # pciutils
  4. #
  5. #############################################################
  6. PCIUTILS_VERSION:=3.0.1
  7. PCIUTILS_SOURCE:=pciutils-$(PCIUTILS_VERSION).tar.gz
  8. PCIUTILS_CAT:=$(ZCAT)
  9. PCIUTILS_SITE:=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
  10. PCIUTILS_DIR:=$(BUILD_DIR)/pciutils-$(PCIUTILS_VERSION)
  11. # Yet more targets...
  12. PCIIDS_SITE:=http://pciids.sourceforge.net/
  13. PCIIDS_SOURCE:=pci.ids.bz2
  14. PCIIDS_CAT:=$(BZCAT)
  15. ifeq ($(BR2_PACKAGE_ZLIB),y)
  16. PCIUTILS_HAVE_ZLIB=yes
  17. PCIIDS_FILE=pci.ids.gz
  18. PCIIDS_COMPRESSOR=gzip -9 -c
  19. else
  20. PCIUTILS_HAVE_ZLIB=no
  21. PCIIDS_FILE=pci.ids
  22. PCIIDS_COMPRESSOR=cat
  23. endif
  24. $(DL_DIR)/$(PCIUTILS_SOURCE):
  25. $(call DOWNLOAD,$(PCIUTILS_SITE),$(PCIUTILS_SOURCE))
  26. $(DL_DIR)/$(PCIIDS_SOURCE):
  27. $(call DOWNLOAD,$(PCIIDS_SITE),$(PCIIDS_SOURCE))
  28. $(PCIUTILS_DIR)/.unpacked: $(DL_DIR)/$(PCIUTILS_SOURCE) $(DL_DIR)/$(PCIIDS_SOURCE)
  29. $(PCIUTILS_CAT) $(DL_DIR)/$(PCIUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  30. $(PCIIDS_CAT) $(DL_DIR)/$(PCIIDS_SOURCE) | $(PCIIDS_COMPRESSOR) > $(PCIUTILS_DIR)/$(PCIIDS_FILE)
  31. toolchain/patch-kernel.sh $(PCIUTILS_DIR) package/pciutils pciutils-$(PCIUTILS_VERSION)\*.patch
  32. #$(CONFIG_UPDATE) $(@D)
  33. $(SED) 's/uname -s/echo Linux/' \
  34. -e 's/uname -r/echo $(LINUX_HEADERS_VERSION)/' \
  35. $(PCIUTILS_DIR)/lib/configure
  36. touch $@
  37. $(PCIUTILS_DIR)/.compiled: $(PCIUTILS_DIR)/.unpacked
  38. $(MAKE1) CC="$(TARGET_CC)" OPT="$(TARGET_CFLAGS)" RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) -C $(PCIUTILS_DIR) \
  39. SHAREDIR="/usr/share/misc" \
  40. ZLIB=$(PCIUTILS_HAVE_ZLIB) \
  41. PREFIX=/usr
  42. touch $@
  43. $(TARGET_DIR)/sbin/lspci: $(PCIUTILS_DIR)/.compiled
  44. $(INSTALL) $(PCIUTILS_DIR)/lspci $(TARGET_DIR)/sbin/lspci
  45. $(STRIPCMD) $(STRIP_STRIP_ALL) $@
  46. $(TARGET_DIR)/sbin/setpci: $(PCIUTILS_DIR)/.compiled
  47. $(INSTALL) $(PCIUTILS_DIR)/setpci $(TARGET_DIR)/sbin/setpci
  48. $(STRIPCMD) $(STRIP_STRIP_ALL) $@
  49. $(TARGET_DIR)/usr/share/misc/$(PCIIDS_FILE): $(PCIUTILS_DIR)/.unpacked
  50. $(INSTALL) -D $(PCIUTILS_DIR)/$(PCIIDS_FILE) $@
  51. pciutils: uclibc $(if $(BR2_PACKAGE_ZLIB),zlib) $(TARGET_DIR)/sbin/setpci $(TARGET_DIR)/sbin/lspci $(TARGET_DIR)/usr/share/misc/$(PCIIDS_FILE)
  52. pciutils-source: $(DL_DIR)/$(PCIUTILS_SOURCE) $(DL_DIR)/$(PCIIDS_SOURCE)
  53. pciutils-clean:
  54. -$(MAKE) -C $(PCIUTILS_DIR) clean
  55. rm -f $(TARGET_DIR)/sbin/lspci $(TARGET_DIR)/sbin/setpci $(TARGET_DIR)/usr/share/misc/pci.ids*
  56. pciutils-dirclean:
  57. rm -rf $(PCIUTILS_DIR)
  58. #############################################################
  59. #
  60. # Toplevel Makefile options
  61. #
  62. #############################################################
  63. ifeq ($(BR2_PACKAGE_PCIUTILS),y)
  64. TARGETS+=pciutils
  65. endif