[Scons-users] always up to date when target is a directory

Dirk Bächle tshortik at gmx.de
Fri Feb 15 10:19:19 EST 2013


Hi Carnë,

On 15.02.2013 02:45, Carnë Draug wrote:

> Hi

>

> The following SCons code says that everything is always up to date,

> even after I change the source:

>

> data = env.Command(target = "results/sequences/",

> source = "scripts/extract_sequences.pl"),

> action = "$SOURCE")

>

> It would appear that the problem is the target being a directory. It

> must be a directory since the source will generate an entire directory

> structure which may different each time it runs. I have tried with and

> without a backslash at the end of the path, and also using target =

> Dir("results/sequences/"), both without success. It always says it's

> up to date, even after I have changed the source file. Am I missing

> anything?


in SCons, directories are up-to-date if they exist. This doesn't depend
on whether they further contain any files or subfolders. If there is a
file that always gets created in the target directory, you could specify
that one as your primary output instead.
Else, you'll probably have to go the long way and define a specialised
Emitter that scans your input file 'extract_sequences.pl' and returns
the full list of target files from it.


> On a related note, how should I specify the paths to be platform compatible?


Using os.path.join() should be sufficient...

Best regards,

Dirk




More information about the Scons-users mailing list