Run/Debug Configuration: Makefile Target
Use this configuration template to run Make targets.
Common settings
When you edit a run configuration (but not a run configuration template), you can specify the following options:
Item | Description |
---|---|
Name | Specify a name for the run configuration to quickly identify it among others when editing or running. |
Allow multiple instances | Allow running multiple instances of this run configuration in parallel. By default, it is disabled, and when you start this configuration while another instance is still running, GoLand suggests stopping the running instance and starting another one. This is helpful when a run configuration consumes a lot of resources and there is no good reason to run multiple instances. |
Store as project file | Save the file with the run configuration settings to share it with other team members. The default location is .idea/runConfigurations. However, if you do not want to share the .idea directory, you can save the configuration to any other directory within the project. By default, it is disabled, and GoLand stores run configuration settings in .idea/workspace.xml. |
Configuration tab
Item | Description |
---|---|
Makefile | Set the path to the |
Targets | Specify a space-separated list of targets. For example, |
Arguments | Provide additional arguments if required. |
Working directory | Specify the working directory to be used for running the application. This directory is the starting point for all relative input and output paths. By default, the field contains the directory where the project file resides. To specify another directory, click and select the directory. |
Environment variables | Create environment variables and specify their values. For more information, refer to Adding environment variables. |
Environment variables and program arguments
You can influence the runtime behavior of your app by adding program arguments and environment variables to suitable run/debug configurations.
Go to
. Alternatively, press Alt+Shift+F10, then 0.In the dialog that opens, select a configuration where you want to pass the arguments and add the environment variables.
Type the arguments in the Argument field. The arguments should be separated with spaces or new lines.
Click to expand the text field, so you can view and edit the arguments as a list.
In the Environment variables field, type the variable name and value:
<name>=<value>
. If you add several variables, they should be separated with semicolons.Alternatively, click and add the variable name and value to the User environment variables list.
In the dialog that opens, you can also see the list of available system environment variables. Clear the System environment variables checkbox if you don't want to use the system environment variables for the selected configuration.
You can reference existing variables, including the parent environment variables, using the
$VAR$
syntax. Note that such references are case-sensitive: for example,PATH=xxx:$PATH$
for Linux/macOS andPath=xxx;$Path$
for Windows.