Yurttas/PL/IL/Ada-95/docs/edit-compile-exec.html

From ZCubes Wiki
Jump to navigation Jump to search



  • using gnat resources for source code editing, compilation/linkage, and execution.

  • editing -
    use vi/vim or emacs, or any simpler, available editor.

    separate/individual procedure textfiles should be named by ada-95 conventions as filename.adb.
    you will be given main procedures usually with numbering like: filename_00.adb.

    packages are either as: filename_p.ads for spec and filename_p.adb for body in two separate/individual textfiles,
    or
    filename_p.ads for spec only in one textfile.
  • compiling -
    1. gnatmake filename
      (assuming main procedure is in a textfile: filename.adb)
      This is compile and link to get an executable named: filename
    2. gcc -c filename.adb
      (assuming main procedure is in a textfile: filename.adb)
      This is compile only and you need to link the compilation results to get an executable by gnatbl filename as filename
    3. gcc -c filename_p.adb
      gcc -c filename.adb
      (assuming main procedure is in a textfile: filename.adb using a package in a textfile: filename_p.adb )
      [the order of compilation is irrelevant, i.e., in any order.}
      This is separate, individual compilation and you need to link the compilation results to get an executable by gnatbl filename as filename
  • executing -
    filename (assuming compilation/linkage produced an executable.)

For detailed information:

  1. GNAT Reference Manual
  2. GNAT User's Guide

  3. Using GNU CC
  4. Debugging with GDB - Source Level debugger
  5. Using the Graphical Interface to GDB