I have a directory structure of
-Root
-Multiple Packages (they all follow this pattern)
-greenhillsCompileSwitches.gpj
-fileWithLocationsOfProjectSource.gpj
-Source Code Directory
-Build Package
-MiscFiles.ada
-Module Directories (They all follow this pattern)
-ModuleDirectories.gpj (contains path of ea module.gpj)
-Modules
-specFileName.ada
-bodyFileName.ada
-module.gpj
The gpj files contain all the switches used for greenhills compilation as well as the paths for all the source files (via the respective gpj throughout the project). I'm trying to convert that structure into a gpr file so I can compile my source files using gnat (gprbuild
)
So far I've succeeded in establishing the correct path and have used the Naming package in the gpr file to get gprbuild
to recognize my spec and body files accordingly. My problem begins with the fact that my ada source files have preprocessor directives in it (as opposed to a separate file, which from documentation i assume is what gnatprep
wants). I have tried using the -gantep
switch, but it also seems to expect a file. I have already checked here and the gnat documentation on my local machine, which is what has gotten me this far.
My gpr file lives in one of the 'Multiple Packages' directories (same directory as the main project gpj to simplify my life by using the same relative paths and have them match) and so far it looks like this
project ProjectName is
for Source_Dirs use ("../Source Code Directory/**");
for Languages use ("Ada");
package Builder is
for Global_Compilation_Switches("Ada") use("-gnat95");
end Builder;
package Compiler is
for Switches("Ada") use ("-gnatep=", "-s"); (this is my attempt)
end Compiler;
package Naming is (using naming since my source files are not .ads/.adb)
for Spec (Name) use "specFileName.ada";
for Body (Name) use "bodyFileName.ada";
end Naming;
Now I realize this is far from complete, but my first goal is to get this thing to compile. My current understanding is that compilation is failing because the preprocessor isn't running and that's why compilation fails (gnat tells me there are illegal characters but greenhills compiles the sources just fine).
Is there a way to tell gnat to pull the directives from the source files themselves?