Mail Archives: djgpp/1999/06/09/11:05:33
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 -