AR=$(CROSS_COMPILE)ar
RANLIB=$(CROSS_COMPILE)ranlib
DLLTOOL=$(CROSS_COMPILE)dlltool
+WINDRES=$(CROSS_COMPILE)windres
# Base name of the library (overridden on NetBSD, which has its own libpci)
LIBNAME=libpci
clean:
rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core -o -name "*.orig"`
- rm -f update-pciids lspci$(EXEEXT) setpci$(EXEEXT) example$(EXEEXT) lib/config.* *.[578] pci.ids.gz lib/*.pc lib/*.so lib/*.so.* lib/*.dll lib/*.def tags
+ rm -f update-pciids lspci$(EXEEXT) setpci$(EXEEXT) example$(EXEEXT) lib/config.* *.[578] pci.ids.gz lib/*.pc lib/*.so lib/*.so.* lib/*.dll lib/*.def lib/dllrsrc.rc tags
rm -rf maint/dist
distclean: clean
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))
--- /dev/null
+#include <windows.h>
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION @PCILIB_VERSION_WINRC@
+PRODUCTVERSION @PCILIB_VERSION_WINRC@
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#if @DEBUG_BUILD@
+FILEFLAGS VS_FF_DEBUG
+#else
+FILEFLAGS 0
+#endif
+FILEOS VOS_NT_WINDOWS32
+FILETYPE VFT_DLL
+FILESUBTYPE 0
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ /*
+ * GNU windres seems that converts 7-bit ASCII strings to UTF-16,
+ * so specify UNICODE/UTF-16 encoding (0x04B0) for these strings.
+ */
+ BLOCK "040904B0" /* Default U.S. English language, UNICODE/UTF-16 codepage */
+ BEGIN
+ VALUE "FileDescription", "libpci"
+ VALUE "FileVersion", "@PCILIB_VERSION@"
+ VALUE "InternalName", "@PCILIB@"
+ VALUE "OriginalFilename", "@PCILIB@"
+ VALUE "ProductName", "pciutils"
+ VALUE "ProductVersion", "@PCILIB_VERSION@"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 0x004B0 /* Default U.S. English language, UNICODE/UTF-16 codepage */
+ END
+END