Date: Sat, 05 Nov 2016 18:47:54 +0100
From: Steffen Nurpmeso <[email protected]>
I am currently fixing the build system of the MUA i maintain
because the portable version of bmake looses CFLAGS (and LDFLAGS
i think) from the environment.
Can you share a small isolated example that demonstrates the problem
you're observing? Certainly bmake does respect environment variables
for make macro expansion:
% printf 'x:;@echo ${CFLAGS}' | CFLAGS=abcd bmake -f /dev/stdin
abcd
% printf 'x:;@echo ${CFLAGS}' | bmake -f /dev/stdin CFLAGS=abcd
abcd
However, following POSIX, any assignments in the makefile itself
override environment variables, unless you use the -e option:
% printf 'CFLAGS=pqrs\nx:;@echo ${CFLAGS}' | CFLAGS=abcd bmake -f /dev/stdin
pqrs
% printf 'CFLAGS=pqrs\nx:;@echo ${CFLAGS}' | CFLAGS=abcd bmake -f /dev/stdin -e
abcd
% printf 'CFLAGS=pqrs\nx:;@echo ${CFLAGS}' | bmake -f /dev/stdin CFLAGS=abcd
abcd