From 23914d070982670cd849ac99d37021e4c05f9baa Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 12 Oct 2016 07:16:51 +0200 Subject: [PATCH 1/3] build: fix config.gypi target 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 --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 84e5bc8e46f710..431d63b8008c06 100644 --- a/Makefile +++ b/Makefile @@ -78,11 +78,12 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ $(PYTHON) tools/gyp_node.py -f make config.gypi: configure - if [ -f $@ ]; then - $(error Stale $@, please re-run ./configure) - else - $(error No $@, please run ./configure first) + @if [ -f $@ ]; then \ + echo Stale $@, please re-run ./$<; \ + else \ + echo No $@, please run ./$< first; \ fi + @exit 1; install: all $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' From 75ec3fb37340120851f99caa76a2e2bbc11500cb Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 12 Oct 2016 13:14:43 +0200 Subject: [PATCH 2/3] add single error message for both missing and stale --- Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 431d63b8008c06..55934a497a7bf2 100644 --- a/Makefile +++ b/Makefile @@ -78,12 +78,7 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ $(PYTHON) tools/gyp_node.py -f make config.gypi: configure - @if [ -f $@ ]; then \ - echo Stale $@, please re-run ./$<; \ - else \ - echo No $@, please run ./$< first; \ - fi - @exit 1; + $(error Missing or stale $@, please re-run ./$<) install: all $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' From 2a093fd387f4ac4a46ad0c142b4a934de775fbba Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 12 Oct 2016 13:20:55 +0200 Subject: [PATCH 3/3] correct error message for both Missing/Stale config.gypi --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 55934a497a7bf2..33bcce6afddc22 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ $(PYTHON) tools/gyp_node.py -f make config.gypi: configure - $(error Missing or stale $@, please re-run ./$<) + $(error Missing or stale $@, please run ./$<) install: all $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'