[Scons-users] Integration with other build system

Dirk Bächle tshortik at gmx.de
Wed May 7 14:32:36 EDT 2014


Hi Matthias,

thanks for your answer, please see below for my further comments.

On 07.05.2014 20:05, Matthias-Christian Ott wrote:

> [...]

>>> 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)?

I wouldn't model it like this. It's a simple Builder with a "*.dpr" as
single source file (=input). The Emitter then parses the project file,
and adds everything else to the list of targets (exe or lib, *.dcu) and
sources (*.pas).
If your *.pas files include additional headers/modules via a mechanism
similar to the inclusion of headers in C/C++, you can write a scanner
for *.pas files. It would then add the included files as implicit
dependencies.

Like this, you shouldn't have to explicitly use a Depends(), Clean() or
SideEffect() anywhere.


>>> [...]

>>> 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()?


Yes, you can.

Regards,

Dirk



More information about the Scons-users mailing list