Closed Bug 914482 Opened 12 years ago Closed 12 years ago

Allow overrides from the command line for variables defined in moz.build

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla26

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

There are many reasons why one may want to run make -C foo BAR=some_value, overriding what is defined in Makefiles. But ever since some variables were moved to moz.build, those variables can't be overriden this way, and it's inconvenient.
Comment on attachment 802043 [details] [diff] [review] Allow overrides from the command line for variables defined in moz.build Review of attachment 802043 [details] [diff] [review]: ----------------------------------------------------------------- ::: config/rules.mk @@ +53,5 @@ > # Using $(firstword) may not be perfect. But it should be good enough for most > # scenarios. > _current_makefile = $(CURDIR)/$(firstword $(MAKEFILE_LIST)) > > +$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\ Do we actually use override? Why the $(subst $(NULL) bit? https://www.gnu.org/software/make/manual/make.html#Origin-Function says $(origin) will always return a value.
Attachment #802043 - Flags: review?(gps) → review+
(In reply to Gregory Szorc [:gps] from comment #2) > Comment on attachment 802043 [details] [diff] [review] > Allow overrides from the command line for variables defined in moz.build > > Review of attachment 802043 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: config/rules.mk > @@ +53,5 @@ > > # Using $(firstword) may not be perfect. But it should be good enough for most > > # scenarios. > > _current_makefile = $(CURDIR)/$(firstword $(MAKEFILE_LIST)) > > > > +$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\ > > Do we actually use override? We don't, but better safe than sorry. (and I think we should, for some variables) > Why the $(subst $(NULL) bit? > https://www.gnu.org/software/make/manual/make.html#Origin-Function says > $(origin) will always return a value. Because some values returned by origin contain a space.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: