COBOL アプリケーションのビルド

アプリケーションをビルドするには、プログラムをコンパイルしてから、ランタイム システムにリンクする必要があります。IDE では、ビルド構成を使用してその方法を定義します。

Micro Focus コンパイラは、次のフェーズを処理します。

ネイティブ COBOL アプリケーションのビルド

ネイティブ COBOL アプリケーションをビルドする際に、コンパイラはまずプログラムの構文エラーをチェックします。次にネイティブのマシン コードを生成します。最後に、リンカーがネイティブのマシン コードを実行可能ファイル (.exe または .dll) にリンクします。

  1. チェック フェーズ - コンパイラはプログラムの構文をチェックし、テストおよびデバッグ用のファイルを生成します。チェック フェーズでは、デバッガーと併用するためのディクショナリ ファイルが作成されます。さらに、INT/GNT プロジェクトをビルドする場合、またはプロジェクト出力タイプを INT/GNT に設定している場合、コンパイラは .int ファイルを生成できます。
  2. 生成フェーズ - 生成フェーズでは、コンパイラは、チェック フェーズで生成される中間コードからネイティブのマシン コードを作成し、業界標準の .obj ファイルを生成します。INT/GNT プロジェクトをビルドする場合、またはプロジェクト出力タイプを INT/GNT に設定している場合、コンパイラは Micro Focus.gnt ファイルを生成できます。

    .int および .gnt ファイルのコードは、ランタイム システムで直接実行できます。オブジェクト コード ファイルは実行できません。オブジェクト コード ファイルは、適切なランタイム システムとリンクして実行可能ファイルを作成する必要があります。

  3. リンク フェーズ - リンク フェーズでは、コードはランタイム システムにリンクされ、実行可能ファイル (.exe.dll) を作成します。 アプリケーションのリンク方法は、IDE でプロジェクトのプロパティを開き、[COBOL Link] ページで指定します。
注: アプリケーションが INT/GNT 出力を生成するように設定されている場合、デフォルトでは、デバッグ構成では .int コードにコンパイルされ、リリース構成では .gnt コードにコンパイルされます。

.NET COBOL アプリケーションのビルド

.NET COBOL アプリケーションをビルドする場合、Micro Focus コンパイラはコードを Microsoft Intermediate Language (IL) ソース ファイルにコンパイルします。このソース ファイルは、アセンブリ ファイル (.exe または .dll) に格納されます。

IDE でのビルドとコマンド ラインからのビルド

Visual COBOL プロジェクトは MSBuild 形式です。Visual Studio でビルドすることも、コマンド ラインでビルドすることもできます。32 ビット版または 64 ビット版の MSBuild を使用できます。

Windows 用の Visual COBOL ビルド ツール

Windows 用の Visual COBOL ビルド ツールは、Visual COBOL の別個にインストール可能なコンポーネントで、COBOL プロジェクトを操作する必要はあるが Visual Studio IDE に関連するオーバーヘッドは避けたい、という場合に使用できます。

詳細については、「Windows 用の Visual COBOL ビルド ツール」を参照してください。

並行ビルド

Building Projects in Parallel
Parallel building in Visual Studio enables you to build multiple projects faster on multi-CPU machines. To optimize the build process, the maximum number of parallel project builds is automatically set to the number of CPUs of your computer, the maximum being 32.

You can configure the number of parallel project builds from Tools > Options > Projects and Solutions > Build and Run.

In order for your multi-project solutions to build in parallel successfully, ensure that the project dependencies and build order are set correctly for your solution using Project > Project Dependencies.

For more details about building projects in parallel in Visual Studio or using MSBuild from the command line, see the Visual Studio help.

制約事項: Parallel builds are not supported with Personal Edition licensing.
Compiling the Files in a Project in Parallel
制約事項: Multi-processor compilation of the sources in a project is only supported for native COBOL. It is not recommended to use with native Object-Oriented COBOL applications.

You can compile your COBOL source code faster on multi-CPU machines if you enable parallel compilation inside a project.

To enable parallel compilation, check the Multi-processor compilation option on the COBOL page in your project's properties. Also, specify the number of Maximum concurrent COBOL compilations option in Tools > Options > Micro Focus Tools > Projects where, by default, the number is automatically set to the number of CPUs of your computer.