bug-make
[Top][All Lists]
Advanced

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

Re: 4.4.1 breaks recursive invocation with --print-directory [when addin


From: Satish Balay
Subject: Re: 4.4.1 breaks recursive invocation with --print-directory [when adding to MAKEFLAGS]
Date: Tue, 28 Feb 2023 22:34:56 -0600 (CST)

On Tue, 28 Feb 2023, Dmitry Goncharov wrote:

> On Tue, Feb 28, 2023 at 8:41 PM Satish Balay via Bug reports and
> discussion for GNU make <bug-make@gnu.org> wrote:
> > $ cat makefile
> > all:
> >         @MAKEFLAGS="-j1 ${MAKEFLAGS}" ${MAKE} -f makefile hello
> > hello:
> >         @echo Hello
> 
> When you pass --print-directory MAKEFLAGS has the value "w".
> When this makefile prepends -j1 the value of MAKEFLAGS becomes "-j1 w".
> Among other changes short options are now in the first word on makeflags.
> 
> Well defined MAKEFLAGS has the following format
> [shortoptions] [-option with arg]... [--long option]... [ -- cli definitions]
> 
> -j carries an argument and is supposed to follow short options.
> 
> If you change to
> MAKEFLAGS="${MAKEFLAGS} -j1" $(MAKE) -f makefile hello
> then it'll work.

For one, the long option '--print-directory' is automatically converted to this 
short notation - contributing to this issue.

And the reason we use the order '-j8 ${MAKEFLAGS}' is so that we have the 
following behavior':

- invoking 'make' defaults to using a default of '-j8'
- invoking 'make -j4' gives: '-j8 -j4' - i.e ability to override this (pre-set) 
default [when needed].

Will have to see if we can reorder options in the recommended order - in our 
intermediate makefile.

thanks,
Satish


> 
> i remember, Paul fixed something like this in glibc makefile.
> However, since users can arrange flags in this random order, we'll
> have to think what to do about this.
> Thanks for your report.
> 
> regards, Dmitry
> 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]