2006-09-09 Martin Mares <mj@ucw.cz>
+ * Makefile, README: Allow installation to be done to a different directory
+ from the one we will eventually be placed in by setting DESTDIR.
+ Patch by Matthew Wilcox.
+
* Added .gitignore files.
* Makefile (clean): Clean *.orig, too.
install: all
# -c is ignored on Linux, but required on FreeBSD
- $(DIRINSTALL) -m 755 $(SBINDIR) $(IDSDIR) $(MANDIR)/man8
- $(INSTALL) -c -m 755 -s lspci setpci $(SBINDIR)
- $(INSTALL) -c -m 755 update-pciids $(SBINDIR)
- $(INSTALL) -c -m 644 pci.ids $(IDSDIR)
- $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(MANDIR)/man8
+ $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8
+ $(INSTALL) -c -m 755 -s lspci setpci $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 644 pci.ids $(DESTDIR)$(IDSDIR)
+ $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
uninstall: all
- rm -f $(SBINDIR)/lspci $(SBINDIR)/setpci $(SBINDIR)/update-pciids
- rm -f $(IDSDIR)/pci.ids
- rm -f $(MANDIR)/man8/lspci.8 $(MANDIR)/man8/setpci.8 $(MANDIR)/man8/update-pciids.8
+ rm -f $(DESTDIR)$(SBINDIR)/lspci $(DESTDIR)$(SBINDIR)/setpci $(DESTDIR)$(SBINDIR)/update-pciids
+ rm -f $(DESTDIR)$(IDSDIR)/pci.ids
+ rm -f $(DESTDIR)$(MANDIR)/man8/lspci.8 $(DESTDIR)$(MANDIR)/man8/setpci.8 $(DESTDIR)$(MANDIR)/man8/update-pciids.8
get-ids:
cp ~/tree/pciids/pci.ids pci.ids
Just run "make" to compile the package and then "make install" to install it.
If you want to change the default installation location, please override
-the ROOT and PREFIX variables specified in the Makefile -- e.g., you can
-use "make PREFIX=/opt/pciutils ROOT=/opt/pciutils install" to create
-a separate installation not interfering with the rest of your system.
+the PREFIX variable specified in the Makefile -- e.g., you can use
+"make PREFIX=/opt/pciutils install" to create a separate installation
+not interfering with the rest of your system. Setting the DESTDIR variable
+will allow you to install to a different directory from the one you intend
+to eventually run it from. This is useful for people who are packaging
+pciutils to install on other computers.
When you are bored of dumping PCI registers, just use "make uninstall".