X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2FMakefile;h=d89cd6c83d92dc2e6ef803ff9fb32ab2788fe67b;hb=8b122188dfd404984eb360e8d876682fe7eb1613;hp=1a729da7c5e5a3b2f540270c8195381a9ead04b1;hpb=d7ea742c6db9993512d809097a1b154c2bae82c9;p=pciutils.git diff --git a/lib/Makefile b/lib/Makefile index 1a729da..d89cd6c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,9 +1,9 @@ # Makefile for The PCI Library -# (c) 1999--2008 Martin Mares +# (c) 1999--2014 Martin Mares -include config.mk +# Expects to be invoked from the top-level Makefile and uses lots of its variables. -OBJS=init access generic dump names filter names-hash names-parse names-net names-cache params +OBJS=init access generic dump names filter names-hash names-parse names-net names-cache names-hwdb params caps INCL=internal.h pci.h config.h header.h sysdep.h types.h ifdef PCI_HAVE_PM_LINUX_SYSFS @@ -42,6 +42,18 @@ ifdef PCI_HAVE_PM_NBSD_LIBPCI OBJS += nbsd-libpci endif +ifdef PCI_HAVE_PM_DARWIN_DEVICE +OBJS += darwin +endif + +ifdef PCI_HAVE_PM_SYLIXOS_DEVICE +OBJS += sylixos-device +endif + +ifdef PCI_HAVE_PM_HURD_CONF +OBJS += hurd +endif + all: $(PCILIB) $(PCILIBPC) ifeq ($(SHARED),no) @@ -50,9 +62,13 @@ $(PCILIB): $(addsuffix .o,$(OBJS)) $(AR) rcs $@ $^ $(RANLIB) $@ else -CFLAGS += -fPIC +CFLAGS += -fPIC -fvisibility=hidden $(PCILIB): $(addsuffix .o,$(OBJS)) - $(CC) -shared $(SONAME) -o $@ $^ $(LIB_LDLIBS) + ifdef PCI_HAVE_PM_DARWIN_DEVICE + $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,-install_name,$(LIBDIR)/$(PCILIB) -o $@ $^ $(LIB_LDLIBS) + else + $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,--version-script=libpci.ver -o $@ $^ $(LIB_LDLIBS) + endif endif $(PCILIBPC): libpci.pc.in @@ -66,7 +82,7 @@ $(PCILIBPC): libpci.pc.in init.o: init.c $(INCL) access.o: access.c $(INCL) params.o: params.c $(INCL) -i386-ports.o: i386-ports.c $(INCL) i386-io-hurd.h i386-io-linux.h i386-io-sunos.h i386-io-windows.h +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 proc.o: proc.c $(INCL) pread.h sysfs.o: sysfs.c $(INCL) pread.h generic.o: generic.c $(INCL) @@ -80,7 +96,7 @@ names-cache.o: names-cache.c $(INCL) names.h names-hash.o: names-hash.c $(INCL) names.h names-net.o: names-net.c $(INCL) names.h names-parse.o: names-parse.c $(INCL) names.h +names-hwdb.o: names-hwdb.c $(INCL) names.h filter.o: filter.c $(INCL) nbsd-libpci.o: nbsd-libpci.c $(INCL) - -example: example.c $(PCILIB) +hurd.o: hurd.c $(INCL)