web analytics
Ada Forge - Project Structure
Project Structure
In order to easily incorporate libraries and frameworks in your app, we recommend to organise your project with the following:

Projet's Directory Structure

myWorkspace/
    myApp/
        ada
            *.ads
            *.adb
            main.ada
        c/
            *.h
            *.c
        Resources/
            (...)
    myLib/
        ada
            *.ads
            *.adb
            main.ada
        c/
            *.h
            *.c
        Resources/
            (...)
    myAppTests/
        (...)
    myAppUITests/
        (...)
    Libs/
        anExternalLib/
            ada
                *.ads
                *.adb
                main.ada
            c/
                *.h
                *.c
            Resources/
                (...)
        anotherExternalLib/
            include/
            lib/
    Frameworks/
        (...)
    Products/
        release/
            myApp
            libmyLib.so;.dll;.dylib
            build/
                *.ali
                *.o
        debug/
            myApp
            libmyLib.so;.dll;.dylib
            build/
                *.ali
                *.o
        profile/
            myApp
            libmyLib.so;.dll;.dylib
            build/
                *.ali
                *.o
        target/arm7/
            myApp
            libmyLib.so;.dll;.dylib
            build/
                *.ali
                *.o

GPRBuild common definitions

abstract project AdaForge is

    type Mode_Type is ("debug", "release", "profile");  --  all possible values
    Mode : Mode_Type := external ("mode", "debug" );

    package Naming is
        for Casing               use "mixedcase";
        for Dot_Replacement      use ".";
        for Spec_Suffix ("Ada")  use ".ads";
        for Body_Suffix ("Ada")  use ".adb";
    end Naming; 

    package IDE is
    end IDE;

--  for Source_Dirs use ("Ada");
--  for Source_Files use ();
--  for Source_List_File use ;

--  for Excluded_Source_Files use ();
--  for Excluded_Source_List_File use ;
--  for Object_Dir use Mode & "/build";

    for Main use ("main.adb");   
--  for Exec_Dir use Mode;
   
    package Builder is
--      for Executable ("main.adb") use Project_Name;
    end Builder;

    package Compiler is
        case Mode is
            when "debug" =>
                for Switches ("Ada") use ("-g","-O0");
            when "release" =>
                for Switches ("Ada") use ("-O3","-gnatn2");
            when "profile" =>
                for Switches ("Ada") use ("-O3","-fomit-frame-pointer","-gnatNp");
        end case;
    end Compiler;

   package Install is
       for Prefix use "$(HOME)/bin";
   end Install;

   package GnatChop is
       for default_switches use ("");
   end GnatChop;

   package GnatPP is
       for default_switches use ("-i4","-M132","-nM","-neU","-ff","-rf");
   end GnatPP;

end AdaForge;