[Scons-users] Building in custom directory and relative paths to source files?
Pawel Tomulik
ptomulik at meil.pw.edu.pl
Sat Apr 20 12:07:20 EDT 2013
Well, some built in tools contain ${SOURCE.file}, for example tex.py,
dvips.py, dvipdf.py, rpcgen.py m4.py have this. I haven't checked them
all, but the described problem seems to exist in 'dvipdf', for example:
# SConstruct
env = Environment()
env.PDF('out/foo.pdf', 'foo.dvi')
yields
ptomulik at barakus:$ scons -Q
cd out && dvipdf foo.dvi foo.pdf
dvips: DVI file can't be opened: foo.dvi: No such file or directory
(unfortunately this produces target file out/foo.pdf, so it's hard to
write good tests for this particular tool).
The proposed changes, if safe enough, could be introduced to the core
builders. If not, then maybe an appropriate techniques could be
recommended in some guidelines for new tools?
W dniu 20.04.2013 16:51, Gary Oberbrunner pisze:
> Hi Pawel; which builders are you talking about? Built-in ones?
>
>
> On Sat, Apr 20, 2013 at 10:26 AM, Pawel Tomulik <ptomulik at meil.pw.edu.pl
> <mailto:ptomulik at meil.pw.edu.pl>> wrote:
>
> Hi,
>
> I've seen that several builders use commands such as:
>
> 'cd ${TARGET.dir} && $FOOCOM ${SOURCE.file} ${TARGET.file}'
>
> This seems to put the restriction that SOURCE and TARGET both must lie
> in same directory. If so, then is there something against using
> 'rel_path' for example?
>
> 'cd ${TARGET.dir} && $FOOCOM ${TARGET.rel_path(SOURCE)} ${TARGET.file}'
>
> In theory it shouldn't alter existing projects (TARGET and SOURCE in
> same directory). It could, however, enable different directories for
> SOURCE and TARGET, and perhaps VariantDir (with duplicate=0) for some
> tools which donot support them at the moment.
>
> What do you think about it?
>
> Another related question - is there any built in method to achieve
> similar goal (relative paths) when lists are substituted (SOURCES,
> TARGETS for example)? I think about something as:
>
> '$FOCOM ${_concat("",SOURCES,"",__env____,RelTo(TARGET))}'
>
> where 'RelTo' is the method of question?
>
> Best regards!
>
> --
> Paweł Tomulik
>
> _________________________________________________
> Scons-users mailing list
> Scons-users at scons.org <mailto:Scons-users at scons.org>
> http://four.pairlist.net/__mailman/listinfo/scons-users
> <http://four.pairlist.net/mailman/listinfo/scons-users>
>
>
>
>
> --
> Gary
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
--
Paweł Tomulik
More information about the Scons-users
mailing list