[Scons-users] Integration with other build system
Matthias-Christian Ott
ott at mirix.org
Wed May 7 14:05:21 EDT 2014
On 2014-05-05 20:17, Dirk Bächle wrote:
> Matthias,
>
> On 05.05.2014 11:30, Matthias-Christian Ott wrote:
>> [...]
>> For example, I have Delphi 5 projects (.dpk) that reference source code
>> files (.pas). The compiler (dcc32) produces object files (.dcu) for each
>> source code file and the project file, moreover it produces a .dcp file
>> and the a library file (.bpl).
> thanks a lot for your clarifications.
> But we're talking about Delphi 5 only, right? Not Delphi 6/7, or any
> higher number...
Yes, Delphi 5. Not upgradeable for reasons.
> I'm asking because I found
>
> http://stackoverflow.com/questions/3118556/is-there-a-dcc32-exe-command-line-switch-to-make-it-use-create-dcu-files
>
>
> at the other end of a web search. They're saying that unless you're
> using the "-m" or "-b" option, "*.dcu"s are kept in-memory only. So, why
> bother with intermediate files in your Emitter?
Delphi itself doesn't seem to use these options. I want both SCons and
Delphi to be able to compile the projects. So Delphi will create .dcu
files anyway and I want to clean them with SCons.
>> [...]
>> No, I execute dcc32 on the .dpk file. dcc32 produces .dcu, .dcp and .bpl
>> or .exe files. Depending on the settings in the .dof file of the project
>> and settings from the Windows Registry, the files are placed in
>> directories outside of the current directory.
>>
>> So I can't have a separate linking phase. I all I want is the following:
>>
>> If I call DelphiProject('filename.dpk') or DelphiProject('filename.dpr')
>> in a SConstruct file, SCons reads filename.dpr/.dpk, extracts all
>> dependencies (source files, resources, forms etc.) from the project
>> files and recursively from the dependencies and also considers binaries
>> (.dcu, .dcp .bpl, .exe) as dependencies.
> That's what you would normally do in an Emitter. Can I have a look at
> your current version?
I'll get back to this question in the next days.
>> However, I don't know where and how to properly insert the dependencies.
>> For .bpl and .exe I do this in the target_from_source method, but for
>> other files I'm not sure. I could for example scan the project file for
>> source files. But what if the source files depend on form files and so
>> on? Where should I declare that dcc32 produces object files for each
>> source file?
> If you have to list your object files (see my comment at the top of this
> mail), you would do this in your Emitter too.
> Parsing your source files automatically, and adding implicit
> dependencies would be a task for a Scanner instead.
I understood this. But what if I want to declare the .dcu files as
side-effects of the .pas files and clean them up with “scons -c”? In
your last e-mail your wrote that the scanner is the wrong place to do
this. That would mean that I have to scan all files twice (in the
emitter to track all .dcu files and the scanner to track all .pass files)?
>> [...]
>
>> My problem is that, I returned the .bpl/.exe, .dcu, .dcp files as
>> targets in the emitter of the builder.
>
> Actually, your problem is that the created targets are located outside
> of your current folder structure, starting from your top-level
> SConstruct and then going down recursively.
> Like this, the default target ".", which is used when you call SCons
> without any further arguments, won't do anything. SCons knows about the
> targets in the distant build folder, but it won't select them...unless
> you specify them explicitly on the command line or via the Default()
> method.
Can I specify multiple targets with Default()?
Regards
Matthias-Christian
More information about the Scons-users
mailing list