1727ce158SMartin Mares# Makefile for The PCI Library 2*36cff2d2SMartin Mares# (c) 1999--2007 Martin Mares <[email protected]> 3727ce158SMartin Mares 4727ce158SMartin Maresinclude config.mk 5727ce158SMartin Mares 63430bafeSMartin MaresOBJS=access.o generic.o dump.o names.o filter.o 7489233b4SMartin MaresINCL=internal.h pci.h config.h header.h sysdep.h types.h 8727ce158SMartin Mares 9848b4347SMartin MaresPCILIB=libpci.a 105670e427SMartin MaresPCILIBPC=libpci.pc 11848b4347SMartin Mares 12489233b4SMartin Maresifdef PCI_HAVE_PM_LINUX_SYSFS 1311f7b31bSMartin MaresOBJS += sysfs.o 1411f7b31bSMartin Maresendif 1511f7b31bSMartin Mares 16489233b4SMartin Maresifdef PCI_HAVE_PM_LINUX_PROC 17727ce158SMartin MaresOBJS += proc.o 18727ce158SMartin Maresendif 19727ce158SMartin Mares 20489233b4SMartin Maresifdef PCI_HAVE_PM_INTEL_CONF 21727ce158SMartin MaresOBJS += i386-ports.o 22727ce158SMartin Maresendif 23727ce158SMartin Mares 24489233b4SMartin Maresifdef PCI_HAVE_PM_DUMP 25727ce158SMartin MaresOBJS += dump.o 26727ce158SMartin Maresendif 27727ce158SMartin Mares 28489233b4SMartin Maresifdef PCI_HAVE_PM_FBSD_DEVICE 29168b4f46SMartin MaresOBJS += fbsd-device.o 30168b4f46SMartin MaresCFLAGS += -I/usr/src/sys 3145902995SMartin Maresifdef FREEBSD_SYS 3245902995SMartin MaresCFLAGS += -I${FREEBSD_SYS} 3345902995SMartin Maresendif 34168b4f46SMartin Maresendif 35168b4f46SMartin Mares 36b6359063SMartin Maresifdef PCI_HAVE_PM_OBSD_DEVICE 37b6359063SMartin MaresOBJS += obsd-device.o 38b6359063SMartin Maresendif 39b6359063SMartin Mares 40489233b4SMartin Maresifdef PCI_HAVE_PM_AIX_DEVICE 4114d6c0a3SMartin MaresOBJS += aix-device.o 4214d6c0a3SMartin Maresendif 4314d6c0a3SMartin Mares 44489233b4SMartin Maresifdef PCI_HAVE_PM_NBSD_LIBPCI 45848b4347SMartin MaresOBJS += nbsd-libpci.o 46848b4347SMartin MaresPCILIB=libpciutils.a 47848b4347SMartin Maresendif 48848b4347SMartin Mares 495670e427SMartin Maresall: $(PCILIB) $(PCILIBPC) 50727ce158SMartin Mares 51848b4347SMartin Mares$(PCILIB): $(OBJS) 52727ce158SMartin Mares rm -f $@ 53325a3c50SMartin Mares $(AR) rcs $@ $^ 54325a3c50SMartin Mares $(RANLIB) $@ 55727ce158SMartin Mares 565670e427SMartin Mares$(PCILIBPC): $(PCILIBPC).in 575670e427SMartin Mares sed <$< >$@ -e 's,@PREFIX@,$(PREFIX),' \ 585670e427SMartin Mares -e 's,@INCDIR@,$(INCDIR),' \ 595670e427SMartin Mares -e 's,@LIBDIR@,$(LIBDIR),' \ 605670e427SMartin Mares -e 's,@IDSDIR@,$(IDSDIR),' \ 615670e427SMartin Mares -e 's,@VERSION@,$(VERSION),' \ 625670e427SMartin Mares -e 's,@LIBZ@,$(LIBZ),' 635670e427SMartin Mares 64727ce158SMartin Maresaccess.o: access.c $(INCL) 6511f7b31bSMartin Maresi386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h 6611f7b31bSMartin Maresproc.o: proc.c $(INCL) pread.h 6711f7b31bSMartin Maressysfs.o: sysfs.c $(INCL) pread.h 68727ce158SMartin Maresgeneric.o: generic.c $(INCL) 69727ce158SMartin Maressyscalls.o: syscalls.c $(INCL) 7038a9e3c3SMartin Maresobsd-device.o: obsd-device.c $(INCL) 71168b4f46SMartin Maresfbsd-device.o: fbsd-device.c $(INCL) 7214d6c0a3SMartin Maresaix-device.o: aix-device.c $(INCL) 73727ce158SMartin Maresdump.o: dump.c $(INCL) 74727ce158SMartin Maresnames.o: names.c $(INCL) 75727ce158SMartin Maresfilter.o: filter.c $(INCL) 76848b4347SMartin Maresnbsd-libpci.o: nbsd-libpci.c $(INCL) 7714d4f989SMartin Mares 7814d4f989SMartin Maresexample: example.c $(PCILIB) 79