tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: MAKEFLAGS and build.sh



On Sat, Aug 23, 2008 at 08:19:01AM +1000, Luke Mewburn wrote:
> On Fri, Aug 15, 2008 at 11:39:06AM +0300, Mikko Rapeli wrote:
>   | 
>   |     Allow user to define MAKEFLAGS through build.sh. It's nice when a

                        ^^^^^^ initialize is a better word for it

>   |     MAKEFLAGS=-k is needed to keep going and log all failing objects
>   |     in one run.
>   | 
>   | diff --git a/build.sh b/build.sh
>   | index 026e5b2..cefa19b 100755
>   | --- a/build.sh
>   | +++ b/build.sh
>   | @@ -202,7 +202,7 @@ initdefaults()
>   |           MAKEFLAGS=-X
>   |           ;;
>   |   *)
>   | -         MAKEFLAGS=
>   | +         MAKEFLAGS=$MAKEFLAGS
>   |           ;;
>   |   esac
>   |  
> 
> 
> I don't think we should pass arbitrary MAKEFLAGS through build.sh,
> since certain settings are set internally, and I'm concerned
> that MAKEFLAGS set in the environment could cause difficult to
> diagnose failures.

Ok, my patch only allows user to initialize MAKEFLAGS. Lots of
things are added to MAKEFLAGS past that point in the code. It is not
just cleared on invocation but set initially to the value of a user
defined MAKEFLAGS, which defaults to nothing. Here's a second attempt.

> That doesn't prevent us considering a separate build.sh control
> to explicitly enable the "make -k" behaviour that you desire.

Well, I don't use -k too often, so I think a flag in build.sh would be
overkill. Allowing a user with knowledge to set inital MAKEFLAGS would
be better. Setting CPUFLAGS, CFLAGS, LDFLAGS etc. have no problems with
build.sh so I thought MAKEFLAGS would be similar, at least in the
trivial case of adding a -k.

-Mikko

diff --git a/build.sh b/build.sh
index cefa19b..d1cd89e 100755
--- a/build.sh
+++ b/build.sh
@@ -197,12 +197,14 @@ initdefaults()
        # Some systems have a small ARG_MAX.  -X prevents make(1) from
        # exporting variables in the environment redundantly.
        #
+       # Allow user to provide initial MAKEFLAGS.
+       #
        case "${uname_s}" in
        Darwin | FreeBSD | CYGWIN*)
-               MAKEFLAGS=-X
+               MAKEFLAGS="${MAKEFLAGS} -X"
                ;;
        *)
-               MAKEFLAGS=$MAKEFLAGS
+               MAKEFLAGS=${MAKEFLAGS}
                ;;
        esac
 


Home | Main Index | Thread Index | Old Index