インテル® FPGA SDK for OpenCL™プロ・エディション: プログラミング・ガイド

ID 683846
日付 4/01/2019
Public
ドキュメント目次

6.6.1. Makefileフラグメント例の表示 (example-makefileまたはmakefile)

ホスト・ランタイム・ライブラリーに対してホスト・アプリケーションをコンパイルおよびリンクするために、 インテル® FPGA SDK for OpenCL™ で利用可能なMakefileフラグメント例を表示するには、example-makefileまたはmakefileユーティリティー・コマンドを呼び出します。
コマンドプロンプトで、 aocl example-makefile または aocl makefile ユーティリティー・コマンドを呼び出します。
ソフトウェアは、次のような出力を表示します。
The following are example Makefile fragments for compiling and linking
a host program against the host runtime libraries included with the Intel FPGA SDK for OpenCL.


Example GNU makefile on Linux, with GCC toolchain:

   AOCL_COMPILE_CONFIG=$(shell aocl compile-config)
   AOCL_LINK_CONFIG=$(shell aocl link-config)

   host_prog : host_prog.o
        g++ -o host_prog host_prog.o $(AOCL_LINK_CONFIG)

   host_prog.o : host_prog.cpp
        g++ -c host_prog.cpp $(AOCL_COMPILE_CONFIG)


Example GNU makefile on Windows, with Microsoft Visual C++ command line compiler:

   AOCL_COMPILE_CONFIG=$(shell aocl compile-config)
   AOCL_LINK_CONFIG=$(shell aocl link-config)

   host_prog.exe : host_prog.obj
        link -nologo /OUT:host_prog.exe host_prog.obj $(AOCL_LINK_CONFIG)

   host_prog.obj : host_prog.cpp
        cl /MD /Fohost_prog.obj -c host_prog.cpp $(AOCL_COMPILE_CONFIG)


Example GNU makefile cross-compiling to ARM SoC from Linux or Windows, with
Linaro GCC cross-compiler toolchain:

   CROSS-COMPILER=arm-linux-gnueabihf-
   AOCL_COMPILE_CONFIG=$(shell aocl compile-config --arm)
   AOCL_LINK_CONFIG=$(shell aocl link-config --arm)

   host_prog : host_prog.o
        $(CROSS-COMPILER)g++ -o host_prog host_prog.o $(AOCL_LINK_CONFIG)

   host_prog.o : host_prog.cpp
        $(CROSS-COMPILER)g++ -c host_prog.cpp $(AOCL_COMPILE_CONFIG)