インテル® C++ コンパイラー 14.0 ユーザー・リファレンス・ガイド
makefile を使用して Microsoft* アプリケーションをビルドする場合、コンパイラー変数の値をインテル® コンパイラーで使用できるように変更する必要があります。また、CPPFLAGS で指定されたオプションも確認します。簡単な例を次に示します。
# name of the program
PROGRAM = area.exe
# names of source files
CPPSOURCES = area_main.cpp area_functions.cpp
# names of object files
CPPOBJECTS = area_main.obj area_functions.obj
# Microsoft Compiler options
CPPFLAGS = /RTC1 /EHsc
# Use the Microsoft C++ Compiler
CPP = cl
# link objects
$(PROGRAM): $(CPPOBJECTS)
link.exe /out:$@ $(CPPOBJECTS)
# build objects
area_main.obj: area_main.cpp area_headers.h
area_functions.obj: area_functions.cpp area_headers.h
# clean
clean:
del $(CPPOBJECTS) $(PROGRAM)
インテル® コンパイラーで nmake を実行する前に、環境変数を設定する必要があります。この例では、コンパイラー名のみが変更されています。
# name of the program
PROGRAM = area.exe
# names of source files
CPPSOURCES = area_main.cpp area_functions.cpp
# names of object files
CPPOBJECTS = area_main.obj area_functions.obj
# Intel® C++ Compiler options
CPPFLAGS = /RTC1 /EHsc
# Use the Intel® C++ Compiler
CPP = icl
# link objects
$(PROGRAM): $(CPPOBJECTS)
link.exe
/out:$@ $(CPPOBJECTS)
# build objects
area_main.obj: area_main.cpp area_headers.h
area_functions.obj: area_functions.cpp area_headers.h
# clean
clean:
del
$(CPPOBJECTS) $(PROGRAM)
変更された makefile では、nmake の出力は以下のようになります。
Microsoft ® Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
icl /RTC1 /EHsc /c area_main.cpp area_functions.cpp
Intel® C++ Compiler for applications running on IA-32
(C) 2009 Intel Corporation. All rights reserved.
area_main.cpp
area_functions.cpp
link.exe /out:area.exe area_main.obj area_functions.obj
Microsoft ® Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.