Skip to content

build: fix config.gypi target

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build

Description of change

The config.gypi target has a recipe that uses the control function error to report if the config.gypi file is missing or if it is stale (the configure file was updated which is a prerequisite of this rule).

GNU make has two phases, immediate and deferred. During the first phase it will expand any variables or functions as the makefile is parsed. The recipe in this case is a shell if statement, which is a deferred construct. But the control function $(error) is an immediate construct which will cause the makefile processing to stop during the first phase of the Make process.

If I understand this correctly the only possible outcome of this rule is the "Stale config.gypi, please re-run ./configure" message which will be done in the first phase and then exit. The shell condition will not be considered. So it will never report that the config.gypi is missing.

I've updated the recipe to use the echo command and an exit status. The downside of this is that the error message is not as nice.

Current error message: Makefile:81: *** Stale config.gypi, please re-run ./configure. Stop.

"New error message": $ make config.gypi Stale config.gypi, please re-run ./configure make: *** [config.gypi] Error 1

To verify the stale config.gypi: $ touch configure $ make

To verfify that config.gypi is missing: $ rm config.gypi $ make

Merge request reports

Loading