Using the EMAC OE SDK Projects with Eclipse
The EMAC OE SDK is distributed with a set of example projects intended to demonstrate how to use the EMAC OE toolchain and libraries. This guide demonstrates the process of compiling one of the example projects and running it on the target machine using the Eclipse IDE. A basic familiarity with Eclipse is assumed for this guide. For a quick intro see the First Time Starting Eclipse.
- GNU make
- EMAC OE SDK
EMAC SDK Example: Compile and Run the hello Project
- Make sure the system is configured for the correct target machine and that the IP and user/password are set.
- Create a remote terminal connection. This is necessary to use the Remote System Explorer's SSH Terminal feature in the following procedure.
- Launch Eclipse and Import the SDK projects if not already done.
This guide will compile and upload one of the SDK example projects to a board using make targets. Also, the Eclipse Remote Terminal will be used to run the program.
Open C/C++ perspective
Click Window → Open Perspective → Other... To bring up a dialog window with a list of Perspectives to choose from.
Choose C/C++ and click Ok.
Open Make Target View
Click Window → Show View → Other ... To bring up a dialog window with a list of Views to choose from.
Choose Make → Make Target
Expand projects → hello in the Make Target view.
Double-click the all
makeTarget to compile the project. See Figure 1 below.
maketo run the compiler to compile all of the source files listed in the
CFILESvariable in the
makewill check the modification times of these *.c files against that of the currently existing executable (if there is one) to see if they have been modified since the last time the executable was compiled. If they have, make reruns the toolchain commands necessary to produce a new executable. For a more in-depth explanation see the | GNU `make' Manual
Double click the upload
maketarget to upload the program to the target machine. See Figure 2 below.
maketo use the
wputcommand to send the binary to the target machine using the variables stored in the
Now Connect to the target machine.
Run the program as shown below using the remote terminal created in the Remote Terminal Setup Guide.
The following is a brief description of each command seen in the SSH Terminal window above:
cd /tmp: Change the current working directory to
ls -l: List the current working directory's contents with file permissions shown. Notice that root does not have execute permissions for the file
chmod u+x hello: Give executable permissions to the owner of the
hellofile. Note that this assumes that the same user is used to log in through the SSH Terminal as was specified in
global.propertiesaccording to Step 1 of the Setup for this guide; in this example, the user is
ls -l: List the current working directory's contents with file permissions shown to be sure that root now has execute permission. The new
rootdoes now have execute permissions.
./hello: Execute the binary. The output shown is a simple message printed to the screen, "Hello EMAC OE!".
Example C and Makefile
See example files for more information about the files used in this procedure.
The next step is to create a new Makefile-based Eclipse project.