Here's what you need to do first:
- Install a bunch of dependencies including Mono. This is required because Mono needs an existing installation of Mono to compile itself. Run this command, all on one line:
sudo apt-get install mono-mcs git build-essential autoconf automake libtool bison flex gettext
- Follow the steps in MetaDataProcessor.exe WINE notes. This sets up the MetaDataProcessor, which prepares your compiled assembly to run on the NETMF.
- Follow Mono's instructions to check out the latest version of the Mono source.
- Compile Mono by following these steps (type these commands at the Terminal):
- Change directory to the Mono source directory:
- Configure the Mono source code (change /usr/local to wherever you want to install Mono but do not choose /usr):
- Compile Mono:
- Install Mono (this uses the sudo command to run the command as the super user; you will need to be logged in as an administrative user and you will need to type your password when prompted):
sudo make install
To try compiling a program, use the attached Makefile. This Makefile expects the following:
- mscorlib.dll, Microsoft.SPOT.TinyCore.dll, Microsoft.SPOT.Native.dll, and MetaDataProcessor.exe must be in the same directory as the Makefile. Those three DLLs and MetaDataProcessor.exe were included with the zipfile you downloaded when you installed MetaDataProcessor in the prerequisites section of this post.
- Your program must be named Program.cs, and your AssemblyInfo.cs file needs to be in the Properties/ subdirectory. You can find example programs in the Mono bootloader for Netduino (and sample apps) post, which also includes information on deploying the assemblies to the Netduino.
- If you want to compile anything other than those sample programs, you will probably need to edit the Makefile.