The make invocation can be configured on C/C++ Build page of the Project Properties dialog. Most settings are already set correctly and do not need to be changed. One exception is the Enable parallel build option on the Behavior tab that you may want to enable, especially if you have a multi-core computer.
We do not recommend that you change any setting on property pages under the C/C++ Build tree node.
A project may have several build configurations, where each configuration describes the selected compiler toolchain, debug or release mode, any potential extra include and linker paths, defined symbols, etc. You can activate, create or delete build configurations under the Build Configurations submenu of the project context menu.
OMNeT++ uses makefiles to build the project. You can use a single makefile for the whole project, or a hiearchy of makefiles. Each makefile may be hand-written (i.e. provided by you), or generated automatically. The IDE provides several options for automatically created makefiles.
The build system for an OMNeT++ project can be configured on the OMNeT++ | Makemake page of the Project Properties dialog. All settings you do in this page will affect all build configurations.
The page displays the folder tree of the project. Using controls on the page (Build group in the top-right corner), you can declare that a selected folder contains a hand-written (custom) makefile, or tell the IDE to generate a makefile for you. Generated makefiles will be automatically refreshed before each build. If a makefile is configured for a folder, the makefile kind will be indicated with a small decoration on the folder icon.
The build root folder is indicated with a small arrow. This is the folder in which the IDE's Build function will invoke the make command, so it should contain a makefile. It is expected that this makefile will build the whole project, so it is supposed to invoke all other makefiles, either directly or indirectly. By default, the build root folder is the project root. This is usually fine, but if you really need to change the project build root, overwrite the Build location setting in the C/C++ Build page of the same dialog.
Makefile
;
custom makefiles are also expected to have this name.
In addition to makefiles, you also need to specify where your C++ files are
located (source folders). This is usually the src
folder of the project,
or, for small projects, the project root. It is also possible to exclude folders
from a source folder. The controls on the right-bottom part of the dialog
(Source group) allow you to set up source folders and exclusions on
the project. Source files that are outside source folders or are in an excluded
folder will be ignored by both the IDE and the build process.
Automatically created makefiles are by default deep, meaning that they include all (non-excluded) source files under them in the build. That is, a source file will be included in the build if it is both under a source folder and covered by a makefile. (This applies to automatically generated makefiles; the IDE has obviously no control over the behaviour of custom makefiles.)
Makefile generation for the selected folder can be configured on the Makemake Options dialog, which can be brought up by clicking the Options button on the page. The dialog is described in the next section.
Makefile generation for a folder can be configured in the Makemake Options dialog. To access the dialog, open the OMNeT++ | Makemake page in the Project Properties dialog, select the folder, make sure makefile generation is enabled for it, and click the Options button.
The following sections describe each page of the dialog.
On the first, Target tab of the dialog, you can specify how the final target of the makefile is created.
--make-so
, --make-lib
, --nolink
--meta:export-library
-o
(If you are building a debug configuration, the target name will be implicitly
suffixed by the _dbg
string.)
-O
The Scope tab allows you to configure the scope of the makefile and which source files will be included.
--deep
--meta:recurse
(resolves to multiple -d
options)
-d
The Compile tab allows you to adjust the parameters passed to the compiler during the build process.
Settings that affect the include path:
Source files:
.cc
or .cpp
). We recommend that you use .cc
in your projects. Makemake option: -e
Link options allow the user to fine-tune the linking steps at the end of the build process.
--meta:use-exported-libs
-u
lib
)
and file extension, and also without the -l
option. The library must be on the linker path;
the linker path can be edited on the Library Paths tab of the C/C++ General | Paths and Symbols
page of the Project Properties dialog.
Makemake option: -l
$O/subdir/*.o
.
Makemake option: none (files will become plain makemake arguments)
The Custom tab allows the customization of the makefiles by inserting handwritten makefile fragments into the automatically generated makefile. This lets you contribute additional targets, rules, variables, etc.
makefrag
,
its contents will be automatically copied into the generated makefile, just above the
first target rule. makefrag
allows you to customize the generated makefile to some extent;
for example, you can add new targets (e.g. to generate documentation or run a test suite),
new rules (e.g. to generate source files during the build), override the default target,
add new dependencies to existing targets, overwrite variables, etc.
The dialog lets you edit the contents of the makefrag
file directly (it will be saved
when you accept the dialog).
makefrag
.
Makemake option: -i
The Preview tab displays the command line options that will be passed to
opp_makemake
to generate the makefile. It consists of two parts:
--deep
option will be added to the command line.
Conversely, if you delete --deep
from the command line options, that will cause
the Deep compile checkbox to be unchecked.
Some options are directly opp_makemake
options, others are "meta" options
that will be resolved to one or more opp_makemake
options; see below.
opp_makemake
;
namely, the options that start with --meta:
denote higher-level features offered
by the IDE only. Meta options will be translated to opp_makemake
options by the IDE.
For example, --meta:auto-include-path
will be resolved by the IDE to multiple
-I
options, one for each directory in the C++ source trees of the project.
This field shows the opp_makemake
options after the resolution of the meta options.
When your project references another project (say the INET Framework), your project's build will be affected in the following way: