summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-05-29 17:41:07 +0200
committerPali Rohár <pali@kernel.org>2022-06-10 01:18:35 +0200
commit638892c82689009282d110c2f5749c5b49339711 (patch)
tree2d0538fa2c8858eaaab19dd2581166e3f2bbc6d5 /Makefile
parentf466bee3254e63e009df22d78c44a336901afd55 (diff)
downloadpciutils-638892c82689009282d110c2f5749c5b49339711.tar.gz
Makefile: Fix usage of empty IDSDIR
When IDSDIR is empty then current lspci/setpci directory is assumed. So install PCI_IDS into SBINDIR in this case.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 530ffee..e18a410 100644
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,7 @@ lspci$(EXEEXT): LDLIBS+=$(LIBKMOD_LIBS)
ls-kernel.o: CFLAGS+=$(LIBKMOD_CFLAGS)
update-pciids: update-pciids.sh
- sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
+ sed <$< >$@ "s@^DEST=.*@DEST=$(if $(IDSDIR),$(IDSDIR)/,)$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
chmod +x $@
# The example of use of libpci
@@ -134,7 +134,11 @@ install: all
$(INSTALL) -c -m 755 $(STRIP) lspci$(EXEEXT) $(DESTDIR)$(LSPCIDIR)
$(INSTALL) -c -m 755 $(STRIP) setpci$(EXEEXT) $(DESTDIR)$(SBINDIR)
$(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
+ifneq ($(IDSDIR),)
$(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
+else
+ $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(SBINDIR)
+endif
$(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
$(INSTALL) -c -m 644 pcilib.7 $(DESTDIR)$(MANDIR)/man7
$(INSTALL) -c -m 644 pci.ids.5 $(DESTDIR)$(MANDIR)/man5
@@ -170,7 +174,11 @@ endif
uninstall: all
rm -f $(DESTDIR)$(SBINDIR)/lspci$(EXEEXT) $(DESTDIR)$(SBINDIR)/setpci$(EXEEXT) $(DESTDIR)$(SBINDIR)/update-pciids
+ifneq ($(IDSDIR),)
rm -f $(DESTDIR)$(IDSDIR)/$(PCI_IDS)
+else
+ rm -f $(DESTDIR)$(SBINDIR)/$(PCI_IDS)
+endif
rm -f $(DESTDIR)$(MANDIR)/man8/lspci.8 $(DESTDIR)$(MANDIR)/man8/setpci.8 $(DESTDIR)$(MANDIR)/man8/update-pciids.8
rm -f $(DESTDIR)$(MANDIR)/man7/pcilib.7
rm -f $(DESTDIR)$(MANDIR)/man5/pci.ids.5