Using Makefiles to Compile Your Application

This topic describes use of makefiles to compile your application.

Using Makefiles to Store Information for Compilation

Linux OS and Mac OS X:

To run make from the command line using Intel® C++ Compiler, make sure that /usr/bin is in your path.

To use the Intel compiler, your makefile must include the setting CC=icpc. Use the same setting on the command line to instruct the makefile to use the Intel compiler. If your makefile is written for gcc, the GNU* C compiler, you will need to change those command line options not recognized by the Intel compiler. Now run make, using the following syntax:

make -f my_makefile

Windows OS:

To use a makefile to compile your source files, use the the following syntax:

nmake -f my_makefile.mak [CPP=makefile_name.exe] [LINK32=linker_name.exe]

For example:
prompt> nmake -f your_project.mak CPP=icl.exe LINK32=xilink.exe

Argument

Description

-f

the nmake option to specify a particular makefile

my_makefile.mak

the makefile you want to use to generate object and executable files

CPP

the makefile you want to use to generate object and executable files

LINK32

the linker you want to use

The nmake command creates object files (.obj) and executable files (.exe) from the information provided in the makefile.

See Also


Submit feedback on this help topic

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