X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2FMakefile;h=13c2a1950ac7e93638eff671f4abb48785806f27;hb=4582426202ad6ac6539305dae2c0b70016f014f4;hp=400c32d17df316b0e723532d73fc312f1f4aac4b;hpb=db933955057af7e3a7f19a8a488ac4f4a9ab2593;p=pciutils.git diff --git a/lib/Makefile b/lib/Makefile index 400c32d..13c2a19 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -71,13 +71,29 @@ $(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: dllrsrc.rc.in + sed <$< >$@ -e 's,@PCILIB_VERSION@,$(PCILIB_VERSION),' \ + -e 's,@PCILIB_VERSION_WINRC@,$(subst .,\$(comma),$(PCILIB_VERSION).0),' \ + -e 's,@PCILIB@,$(PCILIB),' \ + -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