delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/09/11:05:33

From: Mike Brenner <mikeb AT mitre DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: GCC in ADA95
Date: Wed, 09 Jun 1999 10:15:00 -0400
Organization: MITRE
Lines: 83
Message-ID: <375E76E4.7BB3EAE3@mitre.org>
References: <3 DOT 0 DOT 6 DOT 32 DOT 19990524162818 DOT 007c8eb0 AT iie DOT ufro DOT cl>
NNTP-Posting-Host: mbrenner-pc.mitre.org
Mime-Version: 1.0
X-Mailer: Mozilla 4.5 [en]C-19990120M (WinNT; U)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Anita, it is possible to set up an object directory, but not that way,
because gnat was designed to be used in conjunction with a library
manager. One of the simplest library managers is to create an object
directory (perhaps using the subst or mkdir commands in DOS). In your
batch file that compiles files, you could copy the file being compiled
into the object directory, chdir to that directory, compile it in that
directory, then chdir back. That way, the entire directory is safe for
deletion at a later time, because the source code files it are merely
copies, just like in a real library management system. An example of
such a batch file is:

 @echo off
rem GNATC1 copies a gnat file to the library (t: or u:) then compiles it

rem     Parameter Usage: GNATC1 (NAME) (EXT) (DIR)
pushdriv
if exist d:onlytest.ing goto t
  copy %3%1%2 u:
                      echo COPIED %3%1%2 u:
  if errorlevel 1     goto notfound
  if not exist u:%1%2 goto notfound
  u:
  echo         GNAT compiling %1%2 in u:
  goto compiling
:t
  copy %3%1%2 t:
                      echo COPIED %3%1%2 t:
  if errorlevel 1     goto notfound
  if not exist t:%1%2 goto notfound
  t:
  echo         GNAT compiling %1%2 in t:
:compiling
  echo on

REM if just syntax checking:

  redir -eo gnatf  %1%2

REM if compiling (add whatever additional parameters are desired):

  redir -eo gcc -c %1%2

  echo off
  if errorlevel 1 goto bad
    popdriv
    goto :end
:notfound
  echo gnatc1.bat could not copy file %3%1%2
:bad
  echo gnatc1 compile failed
  popdriv
  exitcode 2
:end

This batch file assumes that there are  two library directories which
are SUBSTed to drives T: and U:. The T: drive contains the test files,
while the U: drive contains the utility packages used by the test files.
This arrangement is convenient because you seldom wish to delete your
ADTS, I/O drivers, task types, protected types, and distributed
persistent objects. However, you will often want to delete the object
code and executables from test programs, because they are big. During
software upgrades on tiny machines a batch file can be set up to link
and run each test program, deleting the T: directory after each
executable is executed, so the space is continuously recycled, while
keeping the U: directory.

Mike Brenner  mikeb AT mitre DOT org




Anita Lilian Becerra Lagos wrote:

> how compile with gcc in ADA95
> but file *.ali and *.o  remains in a directory
> like for example C:\ Temp
>
> I knows in C it is possible gcc -o C:\temp\file.exe File.c
>
> I Try with  (in ADA)
> gcc -c -o c:\temp\file.ali FILE.adb
> and this is incorrect .

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019