From c5f5bcb331a5b718e25b8ed9f789ff1c3c0efcb2 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 12 Oct 2016 07:16:51 +0200 Subject: [PATCH] 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. bnoordhuis suggested that we simply change this into a single error message: "Missing or stale config.gypi, please run configure" PR-URL: https://github.com/nodejs/node/pull/9053 Reviewed-By: Ben Noordhuis Reviewed-By: Gibson Fahnestock --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 84e5bc8e46f710..33bcce6afddc22 100644 --- a/Makefile +++ b/Makefile @@ -78,11 +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 - $(error Stale $@, please re-run ./configure) - else - $(error No $@, please run ./configure first) - fi + $(error Missing or stale $@, please run ./$<) install: all $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'