1727ce158SMartin Mares# Makefile for The PCI Library 2752d4d9aSMartin Mares# (c) 1999--2008 Martin Mares <[email protected]> 3727ce158SMartin Mares 4727ce158SMartin Maresinclude config.mk 5727ce158SMartin Mares 6*d6dcc545SMartin MaresOBJS=init.o access.o generic.o dump.o names.o filter.o names-hash.o names-parse.o names-net.o names-cache.o params.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 644dd39346SMartin Maresinit.o: init.c $(INCL) 65727ce158SMartin Maresaccess.o: access.c $(INCL) 66*d6dcc545SMartin Maresparams.o: params.c $(INCL) 67fc1ec2acSMartin Maresi386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h i386-io-windows.h 6811f7b31bSMartin Maresproc.o: proc.c $(INCL) pread.h 6911f7b31bSMartin Maressysfs.o: sysfs.c $(INCL) pread.h 70727ce158SMartin Maresgeneric.o: generic.c $(INCL) 71727ce158SMartin Maressyscalls.o: syscalls.c $(INCL) 7238a9e3c3SMartin Maresobsd-device.o: obsd-device.c $(INCL) 73168b4f46SMartin Maresfbsd-device.o: fbsd-device.c $(INCL) 7414d6c0a3SMartin Maresaix-device.o: aix-device.c $(INCL) 75727ce158SMartin Maresdump.o: dump.c $(INCL) 76752d4d9aSMartin Maresnames.o: names.c $(INCL) names.h 77752d4d9aSMartin Maresnames-cache.o: names-cache.c $(INCL) names.h 78752d4d9aSMartin Maresnames-hash.o: names-hash.c $(INCL) names.h 79752d4d9aSMartin Maresnames-net.o: names-net.c $(INCL) names.h 80752d4d9aSMartin Maresnames-parse.o: names-parse.c $(INCL) names.h 81727ce158SMartin Maresfilter.o: filter.c $(INCL) 82848b4347SMartin Maresnbsd-libpci.o: nbsd-libpci.c $(INCL) 8314d4f989SMartin Mares 8414d4f989SMartin Maresexample: example.c $(PCILIB) 85