--- Makefile.orig 2024-02-24 23:10:18 UTC +++ Makefile @@ -1,8 +1,8 @@ # Makefile for The PCI Utilities # (c) 1998--2024 Martin Mares -OPT=-O2 -CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes +#OPT=-O2 +CFLAGS+=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes VERSION=3.11.1 DATE=2024-02-25 @@ -32,11 +32,11 @@ ABI_VERSION=3 ABI_VERSION=3 # Installation directories -PREFIX=/usr/local +#PREFIX=/usr/local BINDIR=$(PREFIX)/bin SBINDIR=$(PREFIX)/sbin SHAREDIR=$(PREFIX)/share -IDSDIR=$(SHAREDIR) +IDSDIR=$(SHAREDIR)/pciids MANDIR:=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi) INCDIR=$(PREFIX)/include LIBDIR=$(PREFIX)/lib @@ -48,9 +48,9 @@ STRIP+=--strip-program $(CROSS_COMPILE)strip STRIP=-s ifdef CROSS_COMPILE STRIP+=--strip-program $(CROSS_COMPILE)strip -CC=$(CROSS_COMPILE)gcc +CC?=$(CROSS_COMPILE)gcc else -CC=cc +CC?=cc endif AR=$(CROSS_COMPILE)ar RANLIB=$(CROSS_COMPILE)ranlib @@ -73,7 +73,7 @@ export export -all: lib/$(PCIIMPLIB) lspci$(EXEEXT) setpci$(EXEEXT) example$(EXEEXT) lspci.8 setpci.8 pcilib.7 pci.ids.5 update-pciids update-pciids.8 $(PCI_IDS) pcilmr$(EXEEXT) pcilmr.8 +all: lspci$(EXEEXT) setpci$(EXEEXT) example$(EXEEXT) lspci.8 setpci.8 pcilib.7 pci.ids.5 update-pciids update-pciids.8 $(PCI_IDS) pcilmr$(EXEEXT) pcilmr.8 lib/$(PCIIMPLIB): $(PCIINC) force $(MAKE) -C lib all @@ -89,8 +89,8 @@ endif COMMON+=compat/getopt.o endif -lspci$(EXEEXT): lspci.o ls-vpd.o ls-caps.o ls-caps-vendor.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o $(COMMON) lib/$(PCIIMPLIB) -setpci$(EXEEXT): setpci.o $(COMMON) lib/$(PCIIMPLIB) +lspci$(EXEEXT): lspci.o ls-vpd.o ls-caps.o ls-caps-vendor.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o $(COMMON) +setpci$(EXEEXT): setpci.o $(COMMON) LSPCIINC=lspci.h $(UTILINC) lspci.o: lspci.c $(LSPCIINC) @@ -113,7 +113,7 @@ update-pciids: update-pciids.sh chmod +x $@ # The example of use of libpci -example$(EXEEXT): example.o lib/$(PCIIMPLIB) +example$(EXEEXT): example.o example.o: example.c $(PCIINC) $(LMROBJS) pcilmr.o: override CFLAGS+=-I .