linino-sdk-docker is a Docker image which bundles the linino toolchain into a 64-bit Debian-Jessie environment simplifying the task of cross-compiling c/c++ code for the yun.
Some familiarity with Docker is required. For those new to Docker, no worries. It doesn't take much time to get up to speed. Docker images are akin to virtual machines, but better. Check out this overview. You will be glad you did.
Setup - Docker Cloud
The easiest way to get started is to simply download the pre-made docker image created from this Dockerfile stored on DockerCloud. If docker is installed on your system, then the following will do it.
docker pull mggd/linino-sdk:v1
Now, you are are ready to go. See SDK Environment below for next steps.
Setup - Build your own image
If you would prefer to build your own image, it is also quite simple...it just takes a bit longer. Note this Dockerfile starts with a base image of mggd/debian:jessie-amd64. This is a clean Debian image I personally built. If you would rather use your own base image just modify this to point to your image, however, make sure your base image is Debian, Jessie, amd64.
git clone https://github.com/gunlock/linino-sdk-docker.git cd linino-sdk-docker git build -t mggd/linino-sdk:v1 .
Now get a cup of coffee :)
The Docker image has environmental variables configured for cross compiling. Your projects can reside in any folder and be agnostic to the toolchain being used and long as you use the environmental variables. For example, you could cross-compile a simple *.c program as follows.
$CC -I $SDK_INCLUDE main.c -o helloworld
$CC will invoke the cross-compiler tool chain. To see all the preconfigured environmental variables, use the printenv command.
Uploading binaries to the yun
One way to upload files is to use scp. Continuing with the example above, you would upload the binary 'helloworld' to the yun as follows...
scp helloworld root@<YUN-IP-ADDR-HERE>:/root/
The binary uploaded to the yun should execute...assuming it has no bugs, of course.