tech-toolchain archive

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

Re: bmake: variable assignments on command line non-overridable?



On Mon, May 06, 2019 at 08:39:11PM +0200, Edgar Fuß wrote:
> > Command line variables are done later, so you can do things like:
> > 
> > INSTDIR=/tmp	# safe default in case user forgot to pass one
> > 
> > in the makefile and then run
> > 
> >   "make install INSTDIR=/opt"
> But I could do that with INSTDIR?=/tmp in the Makefile.

Yes, you could, and maybe the example was not the original reason to
implement it that way (or ?= did not exist).

It is ancient traditional behaviour (always been that way in all makes
I ever used as far as I remember back), and you have to evaluate things
in some order.

Martin



Home | Main Index | Thread Index | Old Index