Exporting Makefiles

If you created an Executable, Shared Library, or Static Library Project, you can use Eclipse* to build a makefile that includes Intel compiler options. See Setting Options for a Project or File. When your project is complete, you can export your makefile and project source files to another directory, then build your project from the command line using make.

Exporting makefiles

To export your makefile:


  1. Select your project in the Eclipse Project Explorer view.

  2. Select File > Export to launch the Export Wizard.

    The Export dialog box opens, showing the Select screen.

  3. Select General > File system, then click Next.

    The File System screen opens.

  4. Check both the hello_world and Release directories in the left-hand pane. Be sure all the project sources in the right-hand pane are also checked.

    Note iconNote

    You may deselect some files in the right-hand pane, such as the hello_world.o object file and hello_world executable. However, you must also select Create directory structure for files in the Options section to successfully create the export directory. This also applies to project files in the hello_world directory.

  5. Use the Browse button to target the export to an existing directory. Eclipse can also create a new directory for full paths entered in the To directory text box. If, for example, you specified /code/makefile as the export directory, Eclipse creates two new sub-directories:

    • /code/makefile/hello_world

    • /code/makefile/hello_world/Release

  6. Click Finish to complete the export.

Running make

In a terminal window, change to the /cpp/hello_world/Release directory, then run make by typing:

make clean all

You should see the following output:

rm -rf  ./hello_world.o  ./hello_world.d  hello_world
 
Building file: ../hello_world.c
Invoking: Intel IA-32 C Compiler
icc -MMD -MP -MF"hello_world.d" -MT"hello_world.d" -c -o "hello_world.o" "../hello_world.c"
Finished building: ../hello_world.c
 
Building target: hello_world
Invoking: Intel IA-32 C Linker
icc  -o"hello_world"  ./hello_world.o
Finished building target: hello_world

This generates the hello_world executable in the same directory.

See Also


Submit feedback on this help topic

Copyright © 1996-2010, Intel Corporation. All rights reserved.