1 # Makefile for The PCI Library
2 # (c) 1999--2014 Martin Mares <mj@ucw.cz>
4 # Expects to be invoked from the top-level Makefile and uses lots of its variables.
6 OBJS=init access generic dump names filter names-hash names-parse names-net names-cache names-hwdb params caps
7 INCL=internal.h pci.h config.h header.h sysdep.h types.h
9 ifdef PCI_HAVE_PM_LINUX_SYSFS
13 ifdef PCI_HAVE_PM_LINUX_PROC
17 ifdef PCI_HAVE_PM_INTEL_CONF
21 ifdef PCI_HAVE_PM_DUMP
25 ifdef PCI_HAVE_PM_FBSD_DEVICE
27 CFLAGS += -I/usr/src/sys
29 CFLAGS += -I${FREEBSD_SYS}
33 ifdef PCI_HAVE_PM_OBSD_DEVICE
37 ifdef PCI_HAVE_PM_AIX_DEVICE
41 ifdef PCI_HAVE_PM_NBSD_LIBPCI
45 ifdef PCI_HAVE_PM_DARWIN_DEVICE
49 ifdef PCI_HAVE_PM_SYLIXOS_DEVICE
50 OBJS += sylixos-device
53 ifdef PCI_HAVE_PM_HURD_CONF
57 all: $(PCILIB) $(PCILIBPC)
60 $(PCILIB): $(addsuffix .o,$(OBJS))
65 CFLAGS += -fPIC -fvisibility=hidden
66 $(PCILIB): $(addsuffix .o,$(OBJS))
67 ifdef PCI_HAVE_PM_DARWIN_DEVICE
68 $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,-install_name,$(LIBDIR)/$(PCILIB) -o $@ $^ $(LIB_LDLIBS)
70 $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,--version-script=libpci.ver -o $@ $^ $(LIB_LDLIBS)
74 $(PCILIBPC): libpci.pc.in
75 sed <$< >$@ -e 's,@PREFIX@,$(PREFIX),' \
76 -e 's,@INCDIR@,$(INCDIR),' \
77 -e 's,@LIBDIR@,$(LIBDIR),' \
78 -e 's,@IDSDIR@,$(IDSDIR),' \
79 -e 's,@VERSION@,$(VERSION),' \
80 -e 's,@LDLIBS@,$(LDLIBS),'
82 init.o: init.c $(INCL)
83 access.o: access.c $(INCL)
84 params.o: params.c $(INCL)
85 i386-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
86 proc.o: proc.c $(INCL) pread.h
87 sysfs.o: sysfs.c $(INCL) pread.h
88 generic.o: generic.c $(INCL)
89 syscalls.o: syscalls.c $(INCL)
90 obsd-device.o: obsd-device.c $(INCL)
91 fbsd-device.o: fbsd-device.c $(INCL)
92 aix-device.o: aix-device.c $(INCL)
93 dump.o: dump.c $(INCL)
94 names.o: names.c $(INCL) names.h
95 names-cache.o: names-cache.c $(INCL) names.h
96 names-hash.o: names-hash.c $(INCL) names.h
97 names-net.o: names-net.c $(INCL) names.h
98 names-parse.o: names-parse.c $(INCL) names.h
99 names-hwdb.o: names-hwdb.c $(INCL) names.h
100 filter.o: filter.c $(INCL)
101 nbsd-libpci.o: nbsd-libpci.c $(INCL)
102 hurd.o: hurd.c $(INCL)