[Scons-users] Per target env variables

RW garlicbready at googlemail.com
Wed Sep 5 19:49:51 EDT 2018


Hi,
I was wondering, I know standard Makefiles have a way of specifying flags
for a given file before the target / rule is defined

such as
$(PY_BUILD)/nlr%.o: CFLAGS += -Os

is this possible in scons? or is the only way to pass in custom env
variables per target is when the target is defined?
https://www.scons.org/doc/latest/HTML/scons-user/ch03s09.html

such as
env.Program('hello', 'hello.c', CFLAGS=['-Os'])

Also the way the docs read I think it doesn't make it clear if your
appending or replacing values in the environment variable (e.g. CFLAGS) for
that specific target (I'm assuming replacing)

I've been trying to see if I could port the Makefiles from micropython
across to scons btw, but as an initial step I've been trying to keep the
logic the same without changing the order of things too much

Many Thanks
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180906/2d36aa5c/attachment.html>


More information about the Scons-users mailing list