Browse Source

Add Visual Studio 2008 project files.
Add standalone Makefiles for the modbus DLL and tests, using the modbus DLL.

oldfaber 12 years ago
parent
commit
fa9acd7679
6 changed files with 634 additions and 0 deletions
  1. 62 0
      src/win32/Make-tests
  2. 26 0
      src/win32/Readme-win32
  3. 20 0
      src/win32/modbus-9.sln
  4. 14 0
      src/win32/modbus.dll.manifest
  5. 55 0
      src/win32/modbus.rc
  6. 457 0
      src/win32/modbus.vcproj

+ 62 - 0
src/win32/Make-tests

@@ -0,0 +1,62 @@
+# Windows makefile
+# --
+#       use mingw make
+#       Get make-3.82-5-mingw32-bin.tar.lzma from
+#       http://sourceforge.net/projects/mingw/files/MinGW/Extension/make/make-3.82-mingw32/
+# --
+#       Set CC=gcc or CC=cl for the pre-defined compilers
+#       before using this Makefile
+# --
+# Compile and link the bandwidth and random tests.
+# Build modbus.dll and the import library before building the tests
+# modbus.lib/libmodbus.a (the import library) should be in this directory
+# modbus.dll should be in this directory or in path
+
+INCLUDES:=-I../.. -I.. -I.
+
+ifeq ($(CC),cl)
+DEFS+=-D_CRT_SECURE_NO_DEPRECATE=1 -D_CRT_NONSTDC_NO_DEPRECATE=1
+CFLAGS=-Zi -W3 -MT -ID:/include/msvc_std
+LDOPTS=-link -incremental:NO 
+LDLIBS=-Fe$@ ws2_32.lib modbus.lib $(LDOPTS)
+RES:=res
+RCOUT=
+endif
+
+ifeq ($(CC),gcc)
+CFLAGS=-g -Wall -O -static -static-libgcc
+LDLIBS=-o$@ -lws2_32 -luser32 -L. -lmodbus
+LDOPTS=
+RES:=o
+RCOUT=-o$@
+endif
+
+CFLAGS+=-DHAVE_CONFIG_H $(DEFS) $(INCLUDES)
+
+.SUFFIXES:
+.SUFFIXES: .c .rc .$(RES) .$(oo)
+
+# pattern rule for resources
+%.$(RES) : %.rc
+	$(RC) $< $(RCOUT)
+
+vpath %.c ../../tests
+vpath %.h ../src
+
+all: random-test-client random-test-server bandwidth-client bandwidth-server-one
+
+random-test-client: random-test-client.c
+	$(LINK.c) $^ $(LDLIBS)
+
+random-test-server: random-test-server.c
+	$(LINK.c) $^ $(LDLIBS)
+
+bandwidth-server-one: bandwidth-server-one.c
+	$(LINK.c) $^ $(LDLIBS)
+
+bandwidth-client: bandwidth-client.c
+	$(LINK.c) $^ $(LDLIBS)
+
+
+clean:
+	-@cmd "/c del /Q /S $(OBJS) *.o *.obj *.exe *.pdb *.ilk *.ncb *.res *.dll *.exp *.lib *.ncb *.a *.map *.asm" > NUL: 2>&1

+ 26 - 0
src/win32/Readme-win32

@@ -0,0 +1,26 @@
+
+Intro
+-----
+
+This directory contains the project file for Visual
+Studio 2008 to build a modbus.dll.
+
+The project file searches for D:/include/msvc_std to
+find stdint.h. See ../../README.rst
+
+config.h and modbus-version.h were generated using
+a Windows native experimental port of zsh and Microsoft cl.
+
+Please note that modbus.dll.manifest hardcodes
+the version number !
+
+
+
+TODO
+----
+
+Fix the ugly need to have config.h and modbus-version.h
+in this directory.
+
+
+oldfaber

+ 20 - 0
src/win32/modbus-9.sln

@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modbus", "modbus.vcproj", "{498E0845-C7F4-438B-8EDE-EF7FC9A74430}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Debug|Win32.ActiveCfg = Debug|Win32
+		{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Debug|Win32.Build.0 = Debug|Win32
+		{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Release|Win32.ActiveCfg = Release|Win32
+		{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 14 - 0
src/win32/modbus.dll.manifest

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity	version="3.1.0.1"	processorArchitecture="*"	name="modbus"/>
+<description>Zsh shell</description>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+  <dependency>
+  </dependency>
+</assembly>

+ 55 - 0
src/win32/modbus.rc

@@ -0,0 +1,55 @@
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include "config.h"
+#include "modbus-version.h"
+
+#define VERSTRING PACKAGE_VERSION
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION LIBMODBUS_VERSION_MAJOR, LIBMODBUS_VERSION_MINOR, LIBMODBUS_VERSION_MICRO, 2
+PRODUCTVERSION LIBMODBUS_VERSION_MAJOR, LIBMODBUS_VERSION_MINOR, LIBMODBUS_VERSION_MICRO, 2
+FILEOS VOS_NT_WINDOWS32
+FILETYPE VFT_APP
+{
+ BLOCK "StringFileInfo"
+ {
+  BLOCK "000004E4"
+  {
+   VALUE "CompanyName", "\x0"
+   VALUE "FileDescription", "libmodbus DLL\x0"
+#if defined(DEBUG) || defined(W32DEBUG)
+# define XDBG   " (debug)"
+#else
+# define XDBG   ""
+#endif
+#if defined(__MINGW32__) && !defined(__MINGW64__)
+   VALUE "FileVersion", VERSTRING " (gcc)" XDBG "\x0"
+#endif
+#if defined(__MINGW64__)
+   VALUE "FileVersion", VERSTRING " (gcc64)" XDBG "\x0"
+#endif
+#if defined(_MSC_VER)
+# if defined(MSC64)
+   VALUE "FileVersion", VERSTRING " (cl64)" XDBG "\x0"
+# else
+   VALUE "FileVersion", VERSTRING " (cl)" XDBG "\x0"
+# endif
+#endif
+   VALUE "InternalName", "modbus.dll\x0"
+   VALUE "LegalCopyright", "© See libmodbus.org\x0"
+   VALUE "OriginalFilename", "modbus.dll\x0"
+   VALUE "ProductName", "Modbus\x0"
+  }
+ }
+ BLOCK "VarFileInfo"
+ {
+   VALUE "Translation", 0x0, 1252
+ }
+}
+
+// Manifest
+#if (_MSC_VER >= 1400)
+// CAVEAT: the manifest has a version string THAT MUST MATCH the DLL version
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "modbus.dll.manifest"
+#endif

+ 457 - 0
src/win32/modbus.vcproj

@@ -0,0 +1,457 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="modbus"
+	ProjectGUID="{498E0845-C7F4-438B-8EDE-EF7FC9A74430}"
+	RootNamespace="modbus"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			EnableManagedIncrementalBuild="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+				Description=""
+				CommandLine=""
+				AdditionalDependencies=""
+				Outputs=""
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				EnableIntrinsicFunctions="true"
+				WholeProgramOptimization="false"
+				AdditionalIncludeDirectories="..\src;..;.;D:/include/msvc_std"
+				PreprocessorDefinitions="HAVE_CONFIG_H;DLLBUILD;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NONSTDC_NO_DEPRECATE=1"
+				MinimalRebuild="false"
+				ExceptionHandling="0"
+				BasicRuntimeChecks="2"
+				RuntimeLibrary="1"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_MSC_VER"
+				ResourceOutputFileName="$(SolutionDir)/modbus.res"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib"
+				Version="1.0.0"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateManifest="true"
+				GenerateDebugInformation="true"
+				GenerateMapFile="true"
+				SubSystem="1"
+				RandomizedBaseAddress="0"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			EnableManagedIncrementalBuild="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+				Description=""
+				CommandLine=""
+				AdditionalDependencies=""
+				Outputs=""
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				WholeProgramOptimization="false"
+				AdditionalIncludeDirectories="..\src;..;.;D:/include/msvc_std"
+				PreprocessorDefinitions="HAVE_CONFIG_H;DLLBUILD;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NONSTDC_NO_DEPRECATE=1"
+				ExceptionHandling="0"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="false"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="0"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions=""
+				AdditionalDependencies="ws2_32.lib"
+				LinkIncremental="0"
+				GenerateManifest="true"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				StackReserveSize="1048576"
+				StackCommitSize="524288"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				LinkTimeCodeGeneration="0"
+				EntryPointSymbol=""
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				SuppressStartupBanner="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+				Description=""
+				CommandLine=""
+				AdditionalDependencies=""
+				Outputs=""
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				WholeProgramOptimization="false"
+				AdditionalIncludeDirectories="$(SolutionDir)"
+				PreprocessorDefinitions=""
+				MinimalRebuild="false"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+				DisableSpecificWarnings="4244;4267"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				StackReserveSize="1048576"
+				StackCommitSize="524288"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+				Description=""
+				CommandLine=""
+				AdditionalDependencies=""
+				Outputs=""
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				WholeProgramOptimization="false"
+				AdditionalIncludeDirectories="$(SolutionDir)"
+				PreprocessorDefinitions=""
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+				DisableSpecificWarnings="4244;4267"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				StackReserveSize="1048576"
+				StackCommitSize="524288"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				LinkTimeCodeGeneration="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\modbus-data.c"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus-rtu.c"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus-tcp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="config.h"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus-private.h"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus-rtu-private.h"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus-rtu.h"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus-tcp-private.h"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus-tcp.h"
+				>
+			</File>
+			<File
+				RelativePath="modbus-version.h"
+				>
+			</File>
+			<File
+				RelativePath="..\modbus.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+			<File
+				RelativePath=".\modbus.rc"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>