diff options
Diffstat (limited to 'lib/compilers/ada.js')
-rw-r--r-- | lib/compilers/ada.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/compilers/ada.js b/lib/compilers/ada.js index daa6d538e..105ee8ae1 100644 --- a/lib/compilers/ada.js +++ b/lib/compilers/ada.js @@ -41,10 +41,14 @@ export class AdaCompiler extends BaseCompiler { } getExecutableFilename(dirPath) { + // The name here must match the value used in the pragma Source_File + // in the user provided source. return path.join(dirPath, 'example'); } getOutputFilename(dirPath) { + // The basename here must match the value used in the pragma Source_File + // in the user provided source. return path.join(dirPath, 'example.o'); } @@ -66,7 +70,13 @@ export class AdaCompiler extends BaseCompiler { optionsForFilter(filters, outputFilename) { let options = []; + // Always add -cargs to the options. If not needed here, put it last. + // It's used in runCompiler to insert the input filename at the correct + // location in the command line. + // input filename is inserted before -cargs. + if (!filters.binary) { + // produce assembly output in outputFilename options.push( 'compile', '-g', // enable debugging @@ -84,12 +94,14 @@ export class AdaCompiler extends BaseCompiler { options = options.concat(this.compiler.intelAsm.split(' ')); } } else { + // produce an executable in the file specified in getExecutableFilename. + // The output file is automatically decided by GNAT based on the Source_File_Name being used. + // As we are for forcing 'example.adb', the output here will be 'example'. options.push( 'make', '-eS', '-g', - 'example', - '-cargs', + '-cargs', // Compiler Switches for gcc. ); } |