### Run Example Source: https://github.com/adacore/gprbuild/blob/master/README.md Run the executable(s) generated from a built example. This command is used after building an example. ```bash make run ``` -------------------------------- ### Specify Install Name for GPRinstall Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Installs a library project and records it under a custom install name 'myapp'. ```bash gprinstall --install-name=myapp lib.gpr ``` -------------------------------- ### Install LIBGPR Libraries Source: https://github.com/adacore/gprbuild/blob/master/README.md Install the LIBGPR libraries. This make target handles the installation of the compiled GPR libraries. ```bash make libgpr.install ``` -------------------------------- ### Install All Sources Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Installs all source files. This is the default behavior and cannot be used with the -m option. ```bash -a ``` -------------------------------- ### Install in Developer Mode Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Installs all files necessary for development, including specs, ALI files, and the library itself. This is the default mode. ```bash --mode=dev ``` -------------------------------- ### Configuring a GPR Project for Library Building Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst This example demonstrates the essential attributes required to configure a GPR project file to build a library. It specifies the library name, object directory, and library installation directory. ```gpr library project Logging is -- "library" is optional for Library_Name use "logging"; -- will create "liblogging.a" on Unix for Object_Dir use "obj"; for Library_Dir use "lib"; -- different from object_dir end Logging; ``` -------------------------------- ### Clean Example Source: https://github.com/adacore/gprbuild/blob/master/README.md Clean up the build artifacts for an example. This command removes generated files after building and running an example. ```bash make clean ``` -------------------------------- ### Specify Installation Prefix Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Sets the root directory for the installation. If not provided, a default location based on the compiler is used. ```bash --prefix={path} ``` -------------------------------- ### GPRinstall with Prefix and Project Specification Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Installs a project with a specified root installation directory and explicitly names the project file. ```bash gprinstall -r --prefix=/my/root/install -P prj2.gpr ``` -------------------------------- ### Install Minimal Sources Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Installs only the interface sources. This option cannot be used with the -a option. ```bash -m ``` -------------------------------- ### Install in Usage Mode Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Installs only the library or executable, without generating project files, specs, or ALI files. This mode is for end-users. ```bash --mode=usage ``` -------------------------------- ### Examples of Attribute References Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Provides concrete examples of how to reference various attributes in GNAT project files. These examples demonstrate referencing project-level attributes, package attributes, and attributes with string literals. ```text project'Object_Dir Naming'Dot_Replacement Imported_Project'Source_Dirs Imported_Project.Naming'Casing Builder'Default_Switches ("Ada") ``` -------------------------------- ### Dry Run Installation Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Performs a dry run of the installation process, displaying the actions that would be taken without actually installing anything. ```bash --dry-run ``` -------------------------------- ### Split Function Example 2 Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates splitting a string by a space separator. This example shows how multiple spaces are handled. ```gpr Split ("-gnatf -gnatv", " ") => ("-gnatf", "gnatv") ``` -------------------------------- ### GPRbuild: Custom Configuration Project Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Shows how to specify a custom configuration project file using the --config switch. ```bash $ gprbuild --config=my_standard.cgpr -P my_project.gpr ``` -------------------------------- ### Bootstrap GPRbuild Source: https://github.com/adacore/gprbuild/blob/master/README.md Use this command to bootstrap GPRbuild, specifying the installation prefix and paths to XML/Ada and gprconfig_kb sources. The script builds and installs GPRbuild to the specified location. ```bash ./bootstrap.sh --with-xmlada=../xmlada --with-kb=../gprconfig_kb --prefix=./bootstrap ``` -------------------------------- ### GPRinstall for Usage Mode Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Installs only the executable files for a project named 'myapp', using the 'usage' mode. ```bash gprinstall --install-name=myapp --mode=usage tools/tools.gpr ``` -------------------------------- ### Specify Project File Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Specifies the project file to be used for the installation process. ```bash -P{proj} ``` -------------------------------- ### Specify Installation Name Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Defines the name recorded for the installation, which also serves as a suffix for include and library directories. ```bash --install-name={name} ``` -------------------------------- ### Basic GPRinstall Invocation Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Invokes GPRinstall to install a project. The main project file must be specified. ```bash gprinstall prj1.gpr ``` -------------------------------- ### String List Concatenation Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst A specific example demonstrating how to initialize a string list by concatenating an empty list with a file name. ```ada List := () & File_Name; -- One string in this list ``` -------------------------------- ### Apex File Naming Rules Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst An example package demonstrating various attributes to model Apex file naming rules, including casing, dot replacement, and language-specific suffixes for Ada. ```gpr package Naming is for Casing use "lowercase"; for Dot_Replacement use "."; for Spec_Suffix ("Ada") use ".1.ada"; for Body_Suffix ("Ada") use ".2.ada"; end Naming; ``` -------------------------------- ### Example Project Invocation Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Demonstrates how to invoke GPRbuild with a specific project file. This example shows a common error scenario where a specified source directory is invalid. ```bash $ gprbuild -P my_project.gpr ada_main.gpr:3:26: "src" is not a valid directory gprbuild: "my_project.gpr" processing failed ``` -------------------------------- ### Install GPRbuild Source: https://github.com/adacore/gprbuild/blob/master/README.md Install GPRbuild after it has been built. This command copies the built executables and libraries to their designated locations. ```bash make install ``` -------------------------------- ### Specify Project Subdirectory Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Configures the subdirectory for installing project files. The default is 'share/gpr'. ```bash --project-subdir={path} ``` -------------------------------- ### Example Compiler Description with Environment Variable Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Retrieves the compiler version by reading the WIND_BASE environment variable. ```xml GCC-WRS cc(arm|pentium) ``` -------------------------------- ### Create Missing Directories Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Ensures that all necessary directories in the installation path are created if they do not already exist. ```bash -p ``` -------------------------------- ### Basic Project File Structure with Empty Packages Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst An example of a project file defining basic source and output directories, main unit, and empty packages for build tools. These packages can be populated with specific attributes. ```gpr project Build is for Source_Dirs use ("common"); for Object_Dir use "obj"; for Exec_Dir use "."; for Main use ("proc.adb"); package Builder is --<<< for gprbuild end Builder; package Compiler is --<<< for the compiler end Compiler; package Binder is --<<< for the binder end Binder; package Linker is --<<< for the linker end Linker; end Build; ``` -------------------------------- ### Specify Build Variables for Installation Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Use --build-var to specify project-specific and generic build variables for selecting installations. If the first variable is not found, subsequent ones are checked. ```bash $ gprinstall -Pproject1 \ --build-var=PROJECT1_BUILD,LIBRARY_TYPE $ gprinstall -Pproject2 \ --build-var=PROJECT2_BUILD,LIBRARY_TYPE ``` -------------------------------- ### GPRclean Invocation Examples Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Basic examples of how to invoke the GPRclean tool to remove build artifacts. Specify the project file to clean. ```bash gprclean -r prj1.gpr ``` ```bash gprclean -c -P prj2.gpr ``` -------------------------------- ### Specify Sources Subdirectory Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Configures the subdirectory for installing source files. The default is 'include/[.]'. ```bash --sources-subdir={path} ``` -------------------------------- ### Example GPRbuild Configuration Chunks Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Illustrates how to define GPRbuild configuration chunks that can be merged. Shows how to append values to existing attributes to avoid conflicts. ```gpr chunk1: package Language_Processing is for Attr1 use ("foo"); end Language_Processing; chunk2: package Language_Processing is for Attr1 use ("bar"); end Language_Processing; ``` ```gpr package Language_Processing is for Attr1 use ("foo", "bar"); end Language_Processing; ``` ```gpr chunk1: package Language_Processing is for Attr1 use Language_Processing'Attr1 & ("foo"); end Language_Processing; chunk2: package Language_Processing is for Attr1 use Language_Processing'Attr1 & ("bar"); end Language_Processing; ``` -------------------------------- ### Specify Executables Subdirectory Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Configures the subdirectory for installing executables. The default is 'bin'. ```bash ---exec-subdir={path} ``` -------------------------------- ### Specify Library Subdirectory Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Configures the subdirectory for installing library and object files. The default is 'lib/[.]'. ```bash --lib-subdir={path} ``` -------------------------------- ### Host Filter Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Example of a filter to activate a chunk only on Intel Linux machines. The 'name' attribute is a regexp matched against the current architecture. ```gpr ``` -------------------------------- ### GPRbuild: Missing Project File Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Demonstrates the error message when GPRbuild is invoked without a project file specified after the -P switch. ```bash $ gprbuild -P gprbuild: project file name missing after -P ``` -------------------------------- ### Example Compiler Description with Languages Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Defines a simple compiler description with a hardcoded list of supported languages. ```xml GNAT gnatmake Ada ``` -------------------------------- ### Naming Convention Example for C and C++ Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates how to specify different body and spec suffixes for C and C++ languages. Attributes are case-insensitive. ```gpr package Naming is for Body_Suffix ("c") use ".c"; for Body_Suffix ("c++") use ".C"; for Spec_Suffix ("c") use ".h"; for Spec_Suffix ("c++") use ".H"; end Naming; ``` -------------------------------- ### Split Function Example 1 Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates splitting a string by a comma separator. The Split function takes the string to split and the separator as arguments. ```gpr Split ("-gnatf,-gnatv", ",") => ("-gnatf", "gnatv") ``` -------------------------------- ### Force Overwrite Existing Files Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Forces gprinstall to overwrite existing files during the installation process. ```bash -f ``` -------------------------------- ### GPRbuild Command Execution Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst This output shows a typical GPRbuild command execution for a project named 'pc_main'. It details the compilation steps for various source files (Ada and C) and the final linking stage. ```sh $ gprbuild -Pc_main gcc -c -pedantic -g main.c gcc -c -gnaty proc.adb gcc -c -gnaty pack.adb gcc -c -pedantic utils.c gprbind main.bexch ... gcc main.o -o main ``` -------------------------------- ### Example: Querying GCC Machine Type Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Executes an external command 'gcc -dumpmachine' to determine the target processor. ```xml gcc -dumpmachine ``` -------------------------------- ### GPRbuild Case Construction Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates a case construction in a GPRbuild project file using a typed string variable to conditionally set compiler switches. ```gpr project MyProj is type OS_Type is ("GNU/Linux", "Unix", "Windows", "VMS"); OS : OS_Type := external ("OS", "GNU/Linux"); package Compiler is case OS is when "GNU/Linux" | "Unix" => for Switches ("Ada") use ("-gnath"); when "Windows" => for Switches ("Ada") use ("-gnatP"); when others => null; end case; end Compiler; end MyProj; ``` -------------------------------- ### Example: Extracting GCC Version Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Executes 'gcc -v' and uses a grep filter to extract the version number from the output. ```xml gcc -v ``` -------------------------------- ### Example gprname usage with multiple directories and patterns Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Demonstrates using gprname with multiple source directories (-d), a directory file (-D), and various naming and exclusion patterns. ```sh $ gprname -P/home/me/proj.gpr -x "*_nt_body.ada" -dsources -dsources/plus -Dcommon_dirs.txt "body_*" "spec_*" ``` -------------------------------- ### GPRbuild Project Extension Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Defines a project 'Work' that extends a base build project and specifies source files. ```gpr project Work extends "../bld/build.gpr" is for Source_Files use ("pack.ads"); -- New spec of Pkg does not need a completion for Excluded_Source_Files use ("pack.adb"); end Work; ``` -------------------------------- ### GPRbuild Verbose Output Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates the verbose output of GPRbuild using the -v option, which includes more detailed compilation, post-compilation, and link commands. ```sh $ gprbuild -Pbuild gcc -c proc.adb gcc -c pack.adb gcc -c utils.c gprbind proc ... gcc proc.o -o proc ``` -------------------------------- ### GPRbuild: Illegal Option Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Illustrates the error message when GPRbuild encounters an illegal command-line option. ```bash $ gprbuild -P c_main.gpr -WW gprbuild: illegal option "-WW" ``` -------------------------------- ### Specify Output Configuration File Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Use the -o switch to specify the name of the configuration file to be generated. If omitted, a default file is created in the GPRbuild installation directory. ```bash -o {file} ``` -------------------------------- ### Cyclic Dependency Example with Limited With Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates how 'limited with' allows cyclic dependencies between projects, but restricts the use of imported project attributes in the importing project. ```gpr with "b.gpr"; with "c.gpr"; project A is for Exec_Dir use B'Exec_Dir; -- OK end A; limited with "a.gpr"; -- Cyclic dependency: A -> B -> A project B is for Exec_Dir use A'Exec_Dir; -- not OK end B; with "d.gpr"; project C is end C; limited with "a.gpr"; -- Cyclic dependency: A -> C -> D -> A project D is for Exec_Dir use A'Exec_Dir; -- not OK end D; ``` -------------------------------- ### Configure Source Directories and Ignore Subdirectories Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Use Source_Dirs to include all files in the specified directory and its subdirectories. Use Ignore_Source_Sub_Dirs to exclude specific subdirectories like .svn or those starting with '@'. ```gpr for Source_Dirs use ("./**"); for Ignore_Source_Sub_Dirs use (".svn", "@*"); ``` -------------------------------- ### GPRslave Hash String Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Use the --hash option with gprslave to ensure the GPRbuild hash value matches, aborting the connection if it does not. ```bash $ gprslave --hash=$(echo $ADA_PROJECT_PATH | shasum) ``` -------------------------------- ### Filtering Compiler Languages Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst This example demonstrates filtering the output of a compiler command to select specific languages. It uses the `` node to keep only specified words from the compiler's output. ```xml gcc -v c,c++,fortran ``` -------------------------------- ### Uninstall Project by Install Name Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Uninstalls a project previously installed under the name 'prj1'. ```bash gprinstall --uninstall prj1 ``` -------------------------------- ### Uninstall Multiple Projects by Common Install Name Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Uninstalls multiple projects that were previously installed under the common name 'myapp'. ```bash gprinstall --uninstall myapp ``` -------------------------------- ### Building Projects with GPRbuild Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Illustrates the command-line usage of GPRbuild for building individual projects and aggregate projects. ```sh gprbuild -PA.gpr ``` ```sh gprbuild -PAgg.gpr ``` ```sh gprbuild -PA.gpr gprbuild -PB.gpr ``` -------------------------------- ### Compiler Filter Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Example of a filter to match GNAT compilers in the 5.x family. Attributes are matched as regular expressions. ```gpr ``` -------------------------------- ### gprname Naming Pattern Examples Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Examples of naming patterns that gprname can use to identify Ada source files. These patterns are similar to shell wildcards. ```sh "*. [12].ada" ``` ```sh "*.ad[sb]*" ``` ```sh "body_*" ``` ```sh "spec_*" ``` -------------------------------- ### Target Filter Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Example of a filter to activate a chunk only when the code is targeted for Linux. The 'name' attribute is a regexp matched against the target architecture. ```gpr ``` -------------------------------- ### Alternative GPRbuild Commands Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates equivalent GPRbuild commands for specifying the project, allowing flexibility in how the project file is referenced. ```sh gprbuild -P build gprbuild -P build.gpr gprbuild -P ./build.gpr ``` -------------------------------- ### Disable Library Linking Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Disables the copying of shared libraries into the installation directory. ```bash --no-lib-link ``` -------------------------------- ### Add Knowledge Base Directory Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Use the --db switch to indicate an additional directory to be parsed for GPRconfig's knowledge base, useful for local XML description files. The --db- switch prevents reading the default knowledge base. ```bash --db {directory} ``` ```bash --db- ``` -------------------------------- ### Empty Package Declaration Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst An example of a minimal, empty package declaration within a GNAT project file. ```gpr project Simple is package Builder is end Builder; end Simple; ``` -------------------------------- ### Building Library and Main Projects Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Commands to build a library project and a dependent main project to ensure all sources are up-to-date. The first command builds the library, and the second builds the project that uses the library. ```sh gprbuild -Plogging.gpr gprbuild -Pbuild.gpr ``` -------------------------------- ### Sharing Compiler and Binder Switches Between Projects Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Shows how to share compiler and binder switch configurations between projects using 'renames' and attribute referencing to avoid duplication. ```gpr project Logging is package Compiler is for Switches ("Ada") use ("-O2"); end Compiler; package Binder is for Switches ("Ada") use ("-E"); end Binder; end Logging; with "logging.gpr"; project Build is package Compiler renames Logging.Compiler; package Binder is for Switches ("Ada") use Logging.Binder'Switches ("Ada"); end Binder; end Build; ``` -------------------------------- ### Enable Library Auto Initialization Support Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Specifies whether library auto initialization is supported. Defaults to 'false'. ```gpr for Library_Auto_Init_Supported use "true"; ``` -------------------------------- ### Configure Dependency Driver for C Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Specifies the command and options to create a dependency file for C sources. The full path name of the source is appended to the last string of the string list value. ```gpr for Dependency_Driver ("C") use ("gcc", "-E", "-Wp,-M", ""); ``` -------------------------------- ### Default Language Configuration Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Specifies the default language for project sources when the 'Languages' attribute is not declared. Example sets the default to 'ada'. ```gpr for Default_Language use "ada"; ``` -------------------------------- ### Passing Compiler Arguments with -cargs Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Example of using the -cargs separator on the GPRbuild command line to pass options to all compilers for all languages. ```bash -cargs opts ``` -------------------------------- ### GPRbuild Indexed Attribute Inheritance Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Demonstrates how indexed attributes can be inherited or overridden, including copying attribute values from another package. ```gpr -- indexed attributes copy (from package Builder in project Default) -- The package name must always be specified, even if it is the current -- package. for Default_Switches use Default.Builder'Default_Switches; ``` -------------------------------- ### Configure Compiler with Path and Name Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Use the --config switch with optional arguments for path and compiler name to specify a particular compiler executable or distinguish between multiple compilers. ```bash gprconfig --config Ada,,,/usr/bin ``` ```bash gprconfig --config C,,,/usr/bin,GCC ``` ```bash gprconfig --config C,,,/usr/bin,gcc ``` -------------------------------- ### Specify Partial Linker Command Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Sets the executable and options for the partial linker. If not specified, partial linking is not performed. ```gpr for Library_Partial_Linker use ("gcc", "-nostdlib", "-Wl,-r", "-o"); ``` -------------------------------- ### Build Main Executables Source: https://github.com/adacore/gprbuild/blob/master/README.md Build the main GPRbuild executables. This command assumes static linking with XML/Ada by default. ```bash make all ``` -------------------------------- ### Specify Mapping Spec Suffix Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Defines the suffix for mapping files for unit specs in languages that support mapping files. Example uses '%s'. ```gpr for Mapping_Spec_Suffix ("Ada") use "%s"; ``` -------------------------------- ### Show All Available Targets Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Use the --show-target switch to display all compilers found on the PATH that match the specified target. ```bash gprconfig --show-targets ``` -------------------------------- ### Specify Mapping Body Suffix Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Defines the suffix for mapping files for unit bodies in languages that support mapping files. Example uses '%b'. ```gpr for Mapping_Spec_Suffix ("Ada") use "%b"; ``` -------------------------------- ### GPRbuild Indexed Attribute Declarations Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Shows examples of declaring indexed attributes in GPRbuild, such as specifying the main body file or compiler switches for specific source files. ```gpr -- indexed attributes for Body ("main") use "Main.ada"; for Switches ("main.ada") use ("-v", "-gnatv"); for Switches ("main.ada") use Builder'Switches ("main.ada") & "-g"; ``` -------------------------------- ### Launch GPRbuild in Distributed Mode (GPR_SLAVES_FILE) Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Configure distributed compilation by providing a file path to the GPR_SLAVES_FILE environment variable, where each line lists a build slave. ```bash $ export GPR_SLAVES_FILE=$HOME/slave-list.txt $ gprbuild --distributed prj.gpr ``` -------------------------------- ### Typed String Declaration Example Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/gnat_project_manager.rst Declares a new string type 'OS' with a restricted set of literal values. This type can only hold one of the specified string values. ```ada type OS is ("GNU/Linux", "Unix", "Windows", "VMS"); ``` -------------------------------- ### Correct Variable Substitution in Configuration for Ada Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Demonstrates the correct syntax for variable substitution within a `` block when specifying the driver for the Ada language. It shows how to use language-specific variables. ```gpr for Driver ("Ada") use "${PATH(ada)}gcc"; -- Correct ``` -------------------------------- ### GPRconfig XML Configuration with Config Chunk Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Example of an XML structure for GPRconfig, showing a `` node containing a `` child element with a GPRbuild package definition. ```xml ... package Language_Processing is for Attr1 use Language_Processing'Attr1 & ("foo"); end Language_Processing; ``` -------------------------------- ### Build with Dynamic XML/Ada Linking Source: https://github.com/adacore/gprbuild/blob/master/README.md Build GPRbuild executables with dynamic linking to XML/Ada. This is an alternative to the default static linking. ```bash make LIBRARY_TYPE=relocatable all ``` -------------------------------- ### Configure Objects Path for Ada Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Specifies an environment variable for the Ada compiler to get the object search path. The value of the environment variable is the object search path. ```gpr for Objects_Path ("Ada") use "ADA_OBJECTS_PATH"; ``` -------------------------------- ### Display Path Information Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/building_with_gprbuild.rst Outputs the configuration project file search path and the user path. This helps in understanding where GPRbuild looks for project files. ```bash --display-paths ``` -------------------------------- ### Configure Include Path for C and Ada Source: https://github.com/adacore/gprbuild/blob/master/doc/gprbuild_ug/companion_tools.rst Specifies environment variables used by the compiler to get the source search path. The value of the environment variable is the source search path. ```gpr for Include_Path ("C") use "CPATH"; for Include_Path ("Ada") use "ADA_INCLUDE_PATH"; ```