Compiler options to specify *.exe file name? 
Author Message
 Compiler options to specify *.exe file name?

Is there anyway from within the BP 7.0 IDE to get the file "X.PAS"
to compile to something other than "X.EXE" ?

For example, for one program I am working one I need 4 different versions -
depending on where it is going to be used.  Tbe differences between the
versions are determined by compiler options - a file called "Defines.Pas"
if {$I Defines.Pas} included at the beginning of the program and all of
its units.

What I would like to do is use the same conditional defines that are in
Defines.Pas to determine the name of the resulting *.exe file.

Eg.,
   {$IFDEF Symbol_1}   { insert directive to compile to EXE_1.exe}   {$ENDIF}
   {$IFDEF Symbol_2}   { insert directive to compile to EXE_2.exe}   {$ENDIF}
   {$IFDEF Symbol_3}   { insert directive to compile to EXE_3.exe}   {$ENDIF}
   {$IFDEF Symbol_4}   { insert directive to compile to EXE_4.exe}   {$ENDIF}

Currently I exit the IDE and use a batch file to compile all four versions -
and rename the *.exe files appropriately.  However, I would prefer to be
able to stay within the IDE so that it is easier for me to go to the source
of compiler errors.  

Thanks, Rob



Wed, 18 Jun 1902 08:00:00 GMT  
 Compiler options to specify *.exe file name?

Quote:

>Is there anyway from within the BP 7.0 IDE to get the file "X.PAS"
>to compile to something other than "X.EXE" ?

Not as far as I know, but why not just create separate main .PAS
files, that contain hardly anything except a directive to include the
real code?

Duncan Murdoch



Wed, 18 Jun 1902 08:00:00 GMT  
 Compiler options to specify *.exe file name?

Quote:

>>Is there anyway from within the BP 7.0 IDE to get the file "X.PAS"
>>to compile to something other than "X.EXE" ?

>Not as far as I know, but why not just create separate main .PAS
>files, that contain hardly anything except a directive to include the
>real code?

>Duncan Murdoch

[summary of my e-mailed response to e-mailed copy of this from
 Duncan Murdoch]
1.) Thanks, I'll do that.
2.) How could I not have thought of it on my own.  Kicked myself.
3.) Other self-effacing [sp.?] comments.

Rob



Wed, 18 Jun 1902 08:00:00 GMT  
 Compiler options to specify *.exe file name?

Quote:



>>>Is there anyway from within the BP 7.0 IDE to get the file "X.PAS"
>>>to compile to something other than "X.EXE" ?

>>Not as far as I know, but why not just create separate main .PAS
>>files, that contain hardly anything except a directive to include the
>>real code?

>>Duncan Murdoch

I'm under the impression that the whole of the main *.PAS (with any
INCLUDEs) is compiled every time, even after a minor change to the
implementation section of a subsidiary unit. So I keep it VERY short, just
calling one procedure from another unit.

Something like :

        program PROG ;
        uses MAINUNIT ;
        BEGIN Job END.

where Job is defined in MAINUNIT.  It's easy to combine that with Duncan's
suggestion, of course.

--

 National Physical Laboratory, Teddington, Middlesex, TW11 0LW, UK
  Direct Telephone +44 181-943 6087, Nearby Fax +44 181-943 7138  
   Offshore news still takes up to a week to get here;  please
    E-mail me a copy of non-UK non-Pascal non-TV followups !  
     Regret system puts unzoned (UK civil) time on messages.



Wed, 18 Jun 1902 08:00:00 GMT  
 Compiler options to specify *.exe file name?

Quote:
> I'm under the impression that the whole of the main *.PAS (with any
> INCLUDEs) is compiled every time, even after a minor change to the
> implementation section of a subsidiary unit. So I keep it VERY short, just
> calling one procedure from another unit.

> Something like :

>         program PROG ;
>         uses MAINUNIT ;
>         BEGIN Job END.

> where Job is defined in MAINUNIT.  It's easy to combine that with Duncan's
> suggestion, of course.

Hmm ... if a unit is changed all units based on that unit (args) are
recompiled, including the main program, which relies on all units. It
seems to me like you have shifted the problem : Now MAINUNIT is recompiled
every time you change a unit ;-)))

- Christian Froeschlin



Wed, 18 Jun 1902 08:00:00 GMT  
 Compiler options to specify *.exe file name?

Quote:


>> I'm under the impression that the whole of the main *.PAS (with any
>> INCLUDEs) is compiled every time, even after a minor change to the
>> implementation section of a subsidiary unit. So I keep it VERY short, just
>> calling one procedure from another unit.

>> Something like :

>>         program PROG ;
>>         uses MAINUNIT ;
>>         BEGIN Job END.

>> where Job is defined in MAINUNIT.  It's easy to combine that with Duncan's
>> suggestion, of course.

>Hmm ... if a unit is changed all units based on that unit (args) are
>recompiled, including the main program, which relies on all units. It
>seems to me like you have shifted the problem : Now MAINUNIT is recompiled
>every time you change a unit ;-)))

BP7 language guide, p.123, paragraph 3, sentence 3 : "If changes are
made only to the implementation or the initialization part, however,
other units that use the unit don't have to be recompiled."

--
John Stockton, Surrey, UK.  Turnpike v1.10.  MIME.



Wed, 18 Jun 1902 08:00:00 GMT  
 Compiler options to specify *.exe file name?

Quote:


>> I'm under the impression that the whole of the main *.PAS (with any
>> INCLUDEs) is compiled every time, even after a minor change to the
>> implementation section of a subsidiary unit. So I keep it VERY short, just
>> calling one procedure from another unit.

>  Well... if you are using Make (as opposed to Build), then TP does
>"conditional compilations", compiling only units that have changed.  

Yes, I was assuming Make or Run, rather than build.

Quote:
>However, if one unit USES a second unit, and the second unit changes,
>then the first unit will have to be recompiled.

Not necessarily.

Quote:
> [ Snipped a lot ]
>  Disclaimer: This could be a lie.  But I'm pretty sure it's right. :)

There's a good proportion of truth in it.  But I suggest you re-read the
thread, and the part of the manual I quoted, and do some tests.  Perhaps
I should emphasise that I was considering the case of a program already
split into several units, and not that of a monolithic *.PAS being split
into a tiny Main and a single large Unit, which is worse than useless.

--
John Stockton, Surrey, UK.  Turnpike v1.12.  MIME.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. How can I get Long File Names in Borland Pascal 7.0 (bp.exe)

2. Getting Long File Name under Windows 95 - D.Exe [01/01]

3. Specifying dbf table name at runtime

4. Compiler Option?

5. Compiler Option?

6. Compiler options - after compile

7. Keystroke to insert compiler options

8. Appending exe to exe file

9. Openning user-specified files.

10. Finding EXE Name?

11. TURBO and TPX options files

12. .EXE compiler

 

 
Powered by phpBB® Forum Software