Per target env variables

RW via Scons-users <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAMMCZ5PAqaKCoq8fLQh8uRb_zYJ4ad49NtXGHV1fyEyxEvyjLg@mail.gmail.com>
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

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.