diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 564471bbbbc6..ac0d84b90f96 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -1279,7 +1279,9 @@ makeFlags = [ "PREFIX=$(out)" ];
make. You must use this instead of
makeFlags if the arguments contain spaces, e.g.
-makeFlagsArray=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar")
+preBuild = ''
+ makeFlagsArray+=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar")
+'';
Note that shell arrays cannot be passed through environment variables,
so you cannot set makeFlagsArray in a derivation