The following topic applies to
Eclipse* for C/C++.
Eclipse* can build a makefile that includes Intel®
C++ Compiler options for created
Executables,
Shared Libraries, or
Static Library
Projects. See
Setting Options for a Project or
File. When the project is complete, export the makefile and project
source files to another directory, then build the project from the command line
using
make.
Exporting makefiles
To export the makefile:
- Select the project in the Eclipse*
Project Explorer view.
- Select
File > Export to launch the
Export Wizard. The
Export
dialog box opens, showing the
Select
screen.
- Select
General > File system, then click
Next. The
File System screen opens.
- Check both the
hello_world and
Release directories in the left-hand pane.
Ensure all project sources are checked in the right-hand pane.
Note
Some files in the right-hand
pane may be deselected, such as the
hello_world.o object file and the
hello_world.exe executable. The,
Create directory structure for files in the
Options section must be selected to
successfully create the export directory. This applies to project files in the
hello_world directory.
- Use the
Browse button to target the export to an
existing directory. Eclipse* can create a new directory for full paths entered
in the
To directory text box. For example, if the
/code/makefile
is specified as the export directory, Eclipse* creates two new sub-directories:
- /code/makefile/hello_world
- /code/makefile/hello_world/Release
- 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 ./new_source_file.o ./new_source_file.d hello_world
Building file: ../new_source_file.c
Invoking: Intel C Compiler
icc -O2 -MMD -MP -MF"new_source_file.d" -MT"new_source_file.d" -c -o "new_source_file.o" "../new_source_file.c"
Finished building: ../new_source_file.c
Building target: hello_world
Invoking: Intel C Linker
icc -o "hello_world" ./new_source_file.o
Finished building target: hello_world
This generates the
hello_world.exe executable in the same directory.