/usr/share/doc/gnat-gps/html/Description-of-the-Projects.html is in gnat-gps-doc 5.0-16.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2002-2010 AdaCore.
This document is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see http://www.gnu.org/licenses/.
A copy of the license is included in the section entitled
"GNU General Public License". -->
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using the GNAT Programming Studio: Description of the Projects</title>
<meta name="description" content="Using the GNAT Programming Studio: Description of the Projects">
<meta name="keywords" content="Using the GNAT Programming Studio: Description of the Projects">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index-table.html#Index-table" rel="index" title="Index table">
<link href="Project-Handling.html#Project-Handling" rel="up" title="Project Handling">
<link href="Supported-Languages.html#Supported-Languages" rel="next" title="Supported Languages">
<link href="Project-Handling.html#Project-Handling" rel="previous" title="Project Handling">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
pre.smallexample {background-color:rgb(240,240,240);
font-family: courier new,courier,fixed;
font-size: 14px;
margin: 0px 40px 0px 40px;
border-width: 1px 2px 2px 1px;
border-top-style: dotted;
border-left-style: dotted;
border-right-style: solid;
border-bottom-style: solid;
border-color: black;}
code {color:black;
font-family: courier new,courier,fixed;
font-size: 14px;}
body {font-family: arial,helvetica,sans-serif;
font-size: 16px;
max-width: 800px;
text-align: justify}
samp {font-family: courier new,courier,fixed;
font-size: 14px}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Description-of-the-Projects"></a>
<div class="header">
<p>
Next: <a href="Supported-Languages.html#Supported-Languages" accesskey="n" rel="next">Supported Languages</a>, Up: <a href="Project-Handling.html#Project-Handling" accesskey="u" rel="up">Project Handling</a> [<a href="Index-table.html#Index-table" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Description-of-the-Projects-1"></a>
<h3 class="section">7.1 Description of the Projects</h3>
<a name="index-project-description"></a>
<a name="Project-files-and-GNAT-tools"></a>
<h4 class="subsection">7.1.1 Project files and GNAT tools</h4>
<a name="index-project-file-1"></a>
<a name="index-GNAT-2"></a>
<p>This section describes what the projects are, and what information
they contain.
</p>
<p>The most important thing to note is that the projects used by GPS are
the same as the ones used by GNAT. These are text files (using the
extension <samp>.gpr</samp>) which can be edited either manually, with any
text editor, or through the more advanced GPS interface.
</p>
<p>The exact syntax of the project files is fully described in the GNAT
User’s Guide (<a href="gnat_ug.html">gnat_ug.html</a>) and GNAT Reference Manual
(<a href="gnat_rm.html">gnat_rm.html</a>). This is recommended reading if you want to use
some of the more advanced capabilities of project files which are not
yet supported by the graphical interface.
</p>
<p>GPS can load any project file, even those that you have been
edited manually. Furthermore, you can manually edit project files
created by GPS.
</p>
<p>Typically you will not need to edit project files manually, since several
graphical tools such as the project wizard (<a href="The-Project-Wizard.html#The-Project-Wizard">The Project Wizard</a>)
and the properties editor(<a href="The-Project-Properties-Editor.html#The-Project-Properties-Editor">The Project Properties Editor</a>) are
provided.
</p>
<a name="index-normalization-of-projects"></a>
<p>GPS doesn’t preserve the layout nor comments of manually created
projects after you have edited them in GPS. For instance, multiple case
statements in the project will be coalesced into a single case statement.
This normalization is required for GPS to be able to preserve the previous
semantic of the project in addition to the new settings.
</p>
<a name="index-GNAT-3"></a>
<p>All command-line GNAT tools are project aware, meaning that the notion
of project goes well beyond GPS’ user interface. Most capabilities
of project files can be accessed without using GPS itself, making
project files very attractive.
</p>
<a name="index-ADA_005fPROJECT_005fPATH"></a>
<p>GPS uses the same mechanisms to locate project files as GNAT
itself:
</p>
<ul>
<li> absolute paths
</li><li> relative paths.
These paths, when used in a with line as described below, are relative
to the location of the project that does the with.
</li><li> ADA_PROJECT_PATH.
If this environment variable is set, it contains a colon-separated (or
semicolon under Windows) list of directories in which the project files are
searched.
</li><li> predefined project path.
The compiler itself defines a predefined project path, in which standard
libraries can be installed, like XML/Ada for instance.
</li></ul>
<a name="Contents-of-project-files"></a>
<h4 class="subsection">7.1.2 Contents of project files</h4>
<a name="index-project-file-2"></a>
<p>Project files contain all the information that describe the
organization of your source files, object files and executables.
</p>
<a name="index-project-comments"></a>
<p>A project file can contain comments, which have the same format as in Ada,
that is they start by "–" and extend to the end of the line.
You can add comments when you edit the project file manually. GPS will
attempt to preserve them when you save the project through the menu, but this
will not always be possible. It helps if the comments are put at the end of
the line, as in
</p>
<div class="smallexample">
<pre class="smallexample">project Default is
for Source_Dirs use (); -- No source in this project
end Default;
</pre></div>
<a name="index-sub-project"></a>
<p>Generally, one project file will not be enough to describe a complex
organization. In this case, you will create and use a project hierarchy,
with a root project importing other sub projects. Each of the projects
and sub projects is responsible for its own set of sources (compiling
them with the appropriate switches, put the resulting files in the
right directories, …).
</p>
<a name="index-GNAT-4"></a>
<p>Each project contains the following information
(see the GNAT user’s guide for the full list)
</p>
<ul>
<li> <b>List of imported projects</b>:
<a name="index-imported-project"></a>
When you are compiling sources from this project, the compiler
(either through GNAT or the automatically generated Makefiles) will
first make sure that all the imported projects have been correctly
recompiled and are up-to-date. This way, dependencies between
source files are properly handled.
<p>If one of the source files of project A depends on some source
files from project B, then B must be imported by A. If this isn’t
the case, the compiler will complain that some of the source files
cannot be found.
</p>
<p>One important rule is that each source file name must be unique in
the project hierarchy (i.e. a file cannot be under control of two
different projects). This ensures that the same file will be found
no matter what project is managing the source file that uses
</p>
</li><li> <b>List of source directories</b>:
<a name="index-source-directory"></a>
All the sources managed by a project are found in one or more
source directories. Each project can have multiple source
directories, and a given source directory might be shared by
multiple projects.
</li><li> <b>Object directory</b>:
<a name="index-object-directory"></a>
When the sources of the project are compiled, the resulting object
files are put into this object directory. There exist exactly one object
directory for each project. If you need to split the object files
among multiple object directories, you need to create multiple
projects importing one another as appropriate.
<p>When sources from imported sub-projects are recompiled, the
resulting object files are put in the sub project’s own object
directory, and will never pollute the parent’s object directory.
</p>
</li><li> <b>Exec directory</b>:
<a name="index-exec-directory"></a>
When a set of object files is linked into an executable, this executable
is put in the exec directory of the project file. If this attribute
is unspecified, the object directory is used.
</li><li> <b>List of source files</b>:
<a name="index-source-file-1"></a>
The project is responsible for managing a set of source
files. These files can be written in any programming
languages. Currently, the graphical interface supports Ada, C and C++.
<p>The default to find this set of source files is to take all the
files in the source directories that follow the naming scheme (see
below) for each language. In addition if you edit the
project file manually, it is possible to provide an explicit list of source
files.
</p>
<p>This attribute cannot be modified graphically yet.
</p>
</li><li> <b>List of main units</b>:
<a name="index-main-unit"></a>
The main units of a project (or main files in some languages) are
the units that contain the main subprogram of the application, and
that can be used to link the rest of the application.
<p>The name of the file is generally related to the name of the
executable.
</p>
<p>A given project file hierarchy can be used to compile and link
several executables. GPS will automatically update the Compile, Run
and Debug menu with the list of executables, based on this list.
</p>
</li><li> <b>Naming schemes</b>:
<a name="index-naming-scheme"></a>
The naming scheme refers to the way files are named for each
languages of the project. This is used by GPS to choose the language
support to use when a source file is opened. This is also used to
know what tools should be used to compile or otherwise work with a
source file.
</li><li> <b>Embedded targets and cross environments</b>:
<a name="index-cross-environment"></a>
GPS supports cross environment software development: GPS itself can
run on a given host, such as GNU/Linux, while compilations, runs and
debugging occur on a different remote host, such as Sun/Solaris.
<a name="index-VxWorks"></a>
<p>GPS also supports embedded targets (VxWorks, …) by specifying
alternate names for the build and debug tools.
</p>
<p>The project file contains the information required to log on the
remote host.
</p>
</li><li> <b>Tools</b>:
<a name="index-tools"></a>
Project files provide a simple way to specify the compiler and
debugger commands to use.
</li><li> <b>Switches</b>:
<a name="index-switches"></a>
Each tool that is used by GPS (compiler, pretty-printer, debugger,
…) has its own set of switches. Moreover, these switches may
depend on the specific file being processed, and the programming
language it is written in.
</li></ul>
<hr>
<div class="header">
<p>
Next: <a href="Supported-Languages.html#Supported-Languages" accesskey="n" rel="next">Supported Languages</a>, Up: <a href="Project-Handling.html#Project-Handling" accesskey="u" rel="up">Project Handling</a> [<a href="Index-table.html#Index-table" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|