1727ce158SMartin Mares# Makefile for The PCI Library 2752d4d9aSMartin Mares# (c) 1999--2008 Martin Mares <[email protected]> 3727ce158SMartin Mares 4538a2423SMartin Mares# Expects to be invoked from the top-level Makefile and uses lots of its variables. 5727ce158SMartin Mares 66d5e39acSMartin MaresOBJS=init access generic dump names filter names-hash names-parse names-net names-cache params caps 7489233b4SMartin MaresINCL=internal.h pci.h config.h header.h sysdep.h types.h 8727ce158SMartin Mares 9489233b4SMartin Maresifdef PCI_HAVE_PM_LINUX_SYSFS 10d7ea742cSMartin MaresOBJS += sysfs 1111f7b31bSMartin Maresendif 1211f7b31bSMartin Mares 13489233b4SMartin Maresifdef PCI_HAVE_PM_LINUX_PROC 14d7ea742cSMartin MaresOBJS += proc 15727ce158SMartin Maresendif 16727ce158SMartin Mares 17489233b4SMartin Maresifdef PCI_HAVE_PM_INTEL_CONF 18d7ea742cSMartin MaresOBJS += i386-ports 19727ce158SMartin Maresendif 20727ce158SMartin Mares 21489233b4SMartin Maresifdef PCI_HAVE_PM_DUMP 22d7ea742cSMartin MaresOBJS += dump 23727ce158SMartin Maresendif 24727ce158SMartin Mares 25489233b4SMartin Maresifdef PCI_HAVE_PM_FBSD_DEVICE 26d7ea742cSMartin MaresOBJS += fbsd-device 27168b4f46SMartin MaresCFLAGS += -I/usr/src/sys 2845902995SMartin Maresifdef FREEBSD_SYS 2945902995SMartin MaresCFLAGS += -I${FREEBSD_SYS} 3045902995SMartin Maresendif 31168b4f46SMartin Maresendif 32168b4f46SMartin Mares 33b6359063SMartin Maresifdef PCI_HAVE_PM_OBSD_DEVICE 34d7ea742cSMartin MaresOBJS += obsd-device 35b6359063SMartin Maresendif 36b6359063SMartin Mares 37489233b4SMartin Maresifdef PCI_HAVE_PM_AIX_DEVICE 38d7ea742cSMartin MaresOBJS += aix-device 3914d6c0a3SMartin Maresendif 4014d6c0a3SMartin Mares 41489233b4SMartin Maresifdef PCI_HAVE_PM_NBSD_LIBPCI 42d7ea742cSMartin MaresOBJS += nbsd-libpci 43848b4347SMartin Maresendif 44848b4347SMartin Mares 45*7cb1afbeSRichard Yaoifdef PCI_HAVE_PM_DARWIN_DEVICE 46*7cb1afbeSRichard YaoOBJS += darwin-device 47*7cb1afbeSRichard Yaoendif 48*7cb1afbeSRichard Yao 495670e427SMartin Maresall: $(PCILIB) $(PCILIBPC) 50727ce158SMartin Mares 51d7ea742cSMartin Maresifeq ($(SHARED),no) 52d7ea742cSMartin Mares$(PCILIB): $(addsuffix .o,$(OBJS)) 53727ce158SMartin Mares rm -f $@ 54325a3c50SMartin Mares $(AR) rcs $@ $^ 55325a3c50SMartin Mares $(RANLIB) $@ 56d7ea742cSMartin Mareselse 572f421184SMartin MaresCFLAGS += -fPIC -fvisibility=hidden 58d7ea742cSMartin Mares$(PCILIB): $(addsuffix .o,$(OBJS)) 59e1a54852SMike Frysinger $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,--version-script=libpci.ver -o $@ $^ $(LIB_LDLIBS) 60d7ea742cSMartin Maresendif 61727ce158SMartin Mares 62d7ea742cSMartin Mares$(PCILIBPC): libpci.pc.in 635670e427SMartin Mares sed <$< >$@ -e 's,@PREFIX@,$(PREFIX),' \ 645670e427SMartin Mares -e 's,@INCDIR@,$(INCDIR),' \ 655670e427SMartin Mares -e 's,@LIBDIR@,$(LIBDIR),' \ 665670e427SMartin Mares -e 's,@IDSDIR@,$(IDSDIR),' \ 675670e427SMartin Mares -e 's,@VERSION@,$(VERSION),' \ 680715b08dSMartin Mares -e 's,@LDLIBS@,$(LDLIBS),' 695670e427SMartin Mares 704dd39346SMartin Maresinit.o: init.c $(INCL) 71727ce158SMartin Maresaccess.o: access.c $(INCL) 72d6dcc545SMartin Maresparams.o: params.c $(INCL) 73550d67d1SMartin Maresi386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h i386-io-windows.h i386-io-cygwin.h 7411f7b31bSMartin Maresproc.o: proc.c $(INCL) pread.h 7511f7b31bSMartin Maressysfs.o: sysfs.c $(INCL) pread.h 76727ce158SMartin Maresgeneric.o: generic.c $(INCL) 77727ce158SMartin Maressyscalls.o: syscalls.c $(INCL) 7838a9e3c3SMartin Maresobsd-device.o: obsd-device.c $(INCL) 79168b4f46SMartin Maresfbsd-device.o: fbsd-device.c $(INCL) 8014d6c0a3SMartin Maresaix-device.o: aix-device.c $(INCL) 81727ce158SMartin Maresdump.o: dump.c $(INCL) 82752d4d9aSMartin Maresnames.o: names.c $(INCL) names.h 83752d4d9aSMartin Maresnames-cache.o: names-cache.c $(INCL) names.h 84752d4d9aSMartin Maresnames-hash.o: names-hash.c $(INCL) names.h 85752d4d9aSMartin Maresnames-net.o: names-net.c $(INCL) names.h 86752d4d9aSMartin Maresnames-parse.o: names-parse.c $(INCL) names.h 87727ce158SMartin Maresfilter.o: filter.c $(INCL) 88848b4347SMartin Maresnbsd-libpci.o: nbsd-libpci.c $(INCL) 89