add knobs for gzip/pci/usb 8/head
authorMike Frysinger <vapier@gentoo.org>
Fri, 30 May 2014 15:23:49 +0000 (11:23 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 30 May 2014 15:23:49 +0000 (11:23 -0400)
Not all systems need these features, so add knobs to turn them off.

Makefile

index 0cbaddd5d71f9dc1a92ff36d2d01fbae45f103be..19f604686377c115a144a033733468b7331cbf59 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,24 @@ else
 endif
 
 PKG_CONFIG ?= pkg-config
+GZIP ?= yes
+NET ?= yes
+PCI ?= yes
 UDEV ?= no
+USB ?= yes
 
-ALL_TARGETS-yes = compress
+COMPRESS_FILES-yes =
+COMPRESS_FILES-$(PCI) += pci.ids.gz
+COMPRESS_FILES-$(USB) += usb.ids.gz
+
+DATA_FILES-yes =
+DATA_FILES-$(GZIP) += $(COMPRESS_FILES-yes)
+DATA_FILES-$(NET) += oui.txt iab.txt
+DATA_FILES-$(PCI) += pci.ids
+DATA_FILES-$(USB) += usb.ids
+
+ALL_TARGETS-yes =
+ALL_TARGETS-$(GZIP) += $(COMPRESS_FILES-yes)
 ALL_TARGETS-$(UDEV) += udev-hwdb
 
 INSTALL_TARGETS-yes = install-base
@@ -51,11 +66,13 @@ MISCDIR=/usr/share/misc
 HWDBDIR=$(shell $(PKG_CONFIG) --variable=udevdir udev)/hwdb.d
 DOCDIR=/usr/share/doc/hwids
 
-install-base: compress
+install-base: $(DATA_FILES-yes)
        mkdir -p $(DESTDIR)$(DOCDIR)
        install -p -m 644 README.md $(DESTDIR)$(DOCDIR)
+ifneq ($(strip $(DATA_FILES-yes)),)
        mkdir -p $(DESTDIR)$(MISCDIR)
-       install -p -m 644 usb.ids pci.ids usb.ids.gz pci.ids.gz oui.txt iab.txt $(DESTDIR)$(MISCDIR)
+       install -p -m 644 $(DATA_FILES-yes) $(DESTDIR)$(MISCDIR)
+endif
 
 install-hwdb:
        mkdir -p $(DESTDIR)$(HWDBDIR)