]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/Makefile
Fixed building on Cygwin.
[pciutils.git] / lib / Makefile
index 1a729da7c5e5a3b2f540270c8195381a9ead04b1..31ca1c106ddc78149edd3ee2041846af4e5508a7 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile for The PCI Library
 # (c) 1999--2008 Martin Mares <mj@ucw.cz>
 
 # Makefile for The PCI Library
 # (c) 1999--2008 Martin Mares <mj@ucw.cz>
 
-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
 INCL=internal.h pci.h config.h header.h sysdep.h types.h
 
 OBJS=init access generic dump names filter names-hash names-parse names-net names-cache params
 INCL=internal.h pci.h config.h header.h sysdep.h types.h
@@ -50,9 +50,9 @@ $(PCILIB): $(addsuffix .o,$(OBJS))
        $(AR) rcs $@ $^
        $(RANLIB) $@
 else
        $(AR) rcs $@ $^
        $(RANLIB) $@
 else
-CFLAGS += -fPIC
+CFLAGS += -fPIC -fvisibility=hidden
 $(PCILIB): $(addsuffix .o,$(OBJS))
 $(PCILIB): $(addsuffix .o,$(OBJS))
-       $(CC) -shared $(SONAME) -o $@ $^ $(LIB_LDLIBS)
+       $(CC) -shared $(SONAME) -Wl,--version-script=libpci.ver -o $@ $^ $(LIB_LDLIBS)
 endif
 
 $(PCILIBPC): libpci.pc.in
 endif
 
 $(PCILIBPC): libpci.pc.in
@@ -66,7 +66,7 @@ $(PCILIBPC): libpci.pc.in
 init.o: init.c $(INCL)
 access.o: access.c $(INCL)
 params.o: params.c $(INCL)
 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)
 proc.o: proc.c $(INCL) pread.h
 sysfs.o: sysfs.c $(INCL) pread.h
 generic.o: generic.c $(INCL)
@@ -82,5 +82,3 @@ names-net.o: names-net.c $(INCL) names.h
 names-parse.o: names-parse.c $(INCL) names.h
 filter.o: filter.c $(INCL)
 nbsd-libpci.o: nbsd-libpci.c $(INCL)
 names-parse.o: names-parse.c $(INCL) names.h
 filter.o: filter.c $(INCL)
 nbsd-libpci.o: nbsd-libpci.c $(INCL)
-
-example: example.c $(PCILIB)