X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2FMakefile;h=84e25b5d8aa0786647d8b7fbce8150b49e97699b;hb=a9df1d1baccbafcd1f4bd7622dd20d3ea684fb75;hp=400c32d17df316b0e723532d73fc312f1f4aac4b;hpb=2d0af6fc3abc1e9bde968668eb27ebf18061d0da;p=pciutils.git diff --git a/lib/Makefile b/lib/Makefile index 400c32d..84e25b5 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -18,6 +18,16 @@ ifdef PCI_HAVE_PM_INTEL_CONF OBJS += i386-ports endif +ifdef PCI_HAVE_PM_MMIO_CONF +OBJS += mmio-ports +PCI_USE_PHYSMEM = 1 +endif + +ifdef PCI_HAVE_PM_ECAM +OBJS += ecam +PCI_USE_PHYSMEM = 1 +endif + ifdef PCI_HAVE_PM_DUMP OBJS += dump endif @@ -59,10 +69,32 @@ OBJS += emulated OBJS += win32-cfgmgr32 endif +ifdef PCI_HAVE_PM_WIN32_KLDBG +OBJS += win32-kldbg +endif + ifdef PCI_HAVE_PM_WIN32_SYSDBG OBJS += win32-sysdbg endif +ifdef PCI_OS_WINDOWS +OBJS += win32-helpers +endif + +ifdef PCI_USE_PHYSMEM +ifndef PCI_OS_WINDOWS +ifdef PCI_OS_DJGPP +OBJS += physmem-djgpp +else +OBJS += physmem-posix +endif +endif +endif + +ifdef PCI_HAVE_PM_AOS_EXPANSION +OBJS += aos-expansion +endif + all: $(PCILIB) $(PCILIBPC) ifeq ($(SHARED),no) @@ -71,13 +103,31 @@ $(PCILIB): $(addsuffix .o,$(OBJS)) $(AR) rcs $@ $^ $(RANLIB) $@ else +ifeq ($(LIBEXT),dll) +all: $(PCIIMPDEF) $(PCIIMPLIB) +build.def: $(PCIIMPDEF) +$(PCIIMPDEF): libpci.ver ver2def.pl + perl ver2def.pl libpci.ver $(PCILIB) build.def $(PCIIMPDEF) +$(PCIIMPLIB): $(PCIIMPDEF) + $(DLLTOOL) --input-def $< --output-lib $@ +comma := , +dllrsrc.rc: winrsrc.rc.in + sed <$< >$@ -e 's,@PCILIB_VERSION@,$(PCILIB_VERSION),' \ + -e 's,@PCILIB_VERSION_WINRC@,$(subst .,\$(comma),$(PCILIB_VERSION).0),' \ + -e 's,@FILENAME@,$(PCILIB),' \ + -e 's,@DESCRIPTION@,libpci,' \ + -e 's,@LIBRARY_BUILD@,1,' \ + -e 's,@DEBUG_BUILD@,$(if $(findstring -g,$(CFLAGS)),1,0),' +dllrsrc.o: dllrsrc.rc + $(WINDRES) --input=$< --output=$@ --input-format=rc --output-format=coff +OBJS += dllrsrc +endif CFLAGS += -fPIC -fvisibility=hidden $(PCILIB): $(addsuffix .o,$(OBJS)) - 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 + $(CC) -shared $(CFLAGS) $(LDFLAGS) $(PCILIB_LDFLAGS) -o $@ $^ $(LIB_LDLIBS) +ifeq ($(LIBEXT),dll) +$(PCILIB): build.def +endif endif $(PCILIBPC): libpci.pc.in @@ -92,9 +142,11 @@ $(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-io-cygwin.h -proc.o: proc.c $(INCL) pread.h -sysfs.o: sysfs.c $(INCL) pread.h +i386-ports.o: i386-ports.c $(INCL) i386-io-access.h i386-io-beos.h i386-io-cygwin.h i386-io-djgpp.h i386-io-haiku.h i386-io-hurd.h i386-io-linux.h i386-io-openbsd.h i386-io-sunos.h i386-io-windows.h +mmio-ports.o: mmio-ports.c $(INCL) physmem.h physmem-access.h +ecam.o: ecam.c $(INCL) physmem.h physmem-access.h +proc.o: proc.c $(INCL) +sysfs.o: sysfs.c $(INCL) generic.o: generic.c $(INCL) emulated.o: emulated.c $(INCL) syscalls.o: syscalls.c $(INCL) @@ -111,8 +163,11 @@ names-hwdb.o: names-hwdb.c $(INCL) names.h filter.o: filter.c $(INCL) nbsd-libpci.o: nbsd-libpci.c $(INCL) hurd.o: hurd.c $(INCL) -win32-cfgmgr32.o: win32-cfgmgr32.c $(INCL) -win32-sysdbg.o: win32-sysdbg.c $(INCL) +win32-helpers.o: win32-helpers.c $(INCL) win32-helpers.h +win32-cfgmgr32.o: win32-cfgmgr32.c $(INCL) win32-helpers.h +win32-kldbg.o: win32-kldbg.c $(INCL) win32-helpers.h +win32-sysdbg.o: win32-sysdbg.c $(INCL) win32-helpers.h +i386-io-windows.h: win32-helpers.h # MinGW32 toolchain has some required Win32 header files in /ddk subdirectory. # But these header files include another header files from /ddk subdirectory