From f4ddb8d3010b998a485992fc210a2a16bbc3a5e8 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 9 Sep 2006 11:52:24 +0200 Subject: [PATCH] Added DESTDIR support. --- ChangeLog | 4 ++++ Makefile | 16 ++++++++-------- README | 9 ++++++--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51c006a..40fb8d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-09-09 Martin Mares + * 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. diff --git a/Makefile b/Makefile index 76ce1d8..7b64441 100644 --- a/Makefile +++ b/Makefile @@ -65,16 +65,16 @@ distclean: clean 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 diff --git a/README b/README index 3228707..9d8df70 100644 --- a/README +++ b/README @@ -45,9 +45,12 @@ The utilities include: (See manual pages for more details) 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". -- 2.39.5