Skip to content

Commit 4de7a6e

Browse files
danbevMyles Borins
authored and
Myles Borins
committed
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: #9053 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 695ee1e commit 4de7a6e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/z
7171
$(PYTHON) tools/gyp_node.py -f make
7272

7373
config.gypi: configure
74-
if [ -f $@ ]; then
75-
$(error Stale $@, please re-run ./configure)
76-
else
77-
$(error No $@, please run ./configure first)
78-
fi
74+
$(error Missing or stale $@, please run ./$<)
7975

8076
install: all
8177
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'

0 commit comments

Comments
 (0)