File: gprbuild.gpr

package info (click to toggle)
gprbuild 2015-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,228 kB
  • ctags: 67
  • sloc: ada: 27,214; xml: 4,127; makefile: 337; sh: 227; cpp: 89; fortran: 62; ansic: 37
file content (105 lines) | stat: -rw-r--r-- 3,062 bytes parent folder | download
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
with "xmlada.gpr";

project Gprbuild is

   type Build_Type is ("debug", "production", "coverage", "profiling");
   Bld : Build_Type := external ("BUILD", "debug");

   type VCS_Type is ("Subversion", "Git", "auto");
   VCS_Kind : VCS_Type := external ("PRJ_VCS", "Subversion");

   Processors := external ("PROCESSORS", "1");

   for Languages use ("Ada", "C");

   for Main use
       ("gprconfig-main.adb",
        "gprbuild-main.adb",
        "gprbind.adb",
        "gprlib.adb",
        "gprclean-main.adb",
        "gprinstall-main.adb",
        "gprslave.adb");

   for Source_Dirs use ("src", "gnat");

   case Bld is
      when "production" => for Object_Dir use "obj";
      when "coverage"   => for Object_Dir use "obj-cov";
      when "profiling"  => for Object_Dir use "obj-prof";
      when "debug"      => for Object_Dir use "obj-debug";
   end case;

   for Exec_Dir use ".";

   package Builder is
      for Executable ("gprconfig-main.adb") use "gprconfig";
      for Executable ("gprbuild-main.adb") use "gprbuild";
      for Executable ("gprclean-main.adb") use "gprclean";
      for Executable ("gprinstall-main.adb") use "gprinstall";
      for Default_Switches ("Ada") use ("-m", "-j" & Processors);
   end Builder;

   package Compiler is
      common_switches := ("-gnat12", "-gnaty", "-gnatQ");
      case Bld is
         when "debug" =>
            for Default_Switches ("Ada") use common_switches &
            ("-g", "-gnata", "-gnatVa", "-gnatwaCJI"
             , "-gnatwe"
             , "-gnatyg"
             );

            for Local_Configuration_Pragmas use "debug.adc";
         when "coverage" =>
            for Default_Switches ("Ada") use common_switches &
              ("-ftest-coverage", "-fprofile-arcs");
         when "profiling" =>
            for Default_Switches ("Ada") use common_switches &
              ("-pg", "-g");
         when "production" =>
            for Default_Switches ("Ada") use common_switches &
              ("-O2", "-gnatpn", "-gnatws");

            --  Compile all GPRbuild sources to support symbolic-traceback

            for Switches ("gpr*.ad?") use
              Compiler'Default_Switches ("Ada") & ("-g1");
      end case;
   end Compiler;

   package Binder is
      common_switches := ("-E", "-static");
      case Bld is
         when "debug" =>
            for Default_Switches ("Ada") use common_switches
              & ("-Sin")
            ;

         when "coverage" | "profiling" | "production" =>
            for Default_Switches ("Ada") use common_switches;
         end case;
   end Binder;

   package Linker is
      case Bld is
         when "production" =>
            null;

         when "debug" =>
            for Default_Switches ("Ada") use ("-g");

         when "coverage"             =>
            for Default_Switches ("Ada") use ("-lgcov");

         when "profiling"            =>
            for Default_Switches ("Ada") use ("-pg", "-g");

      end case;
   end Linker;

   package IDE is
      for VCS_Kind use VCS_Kind;
   end IDE;

end Gprbuild;