mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
build: extract common code from NODE_EXE/_G_EXE
This commit extracts common parts of the NODE_EXE, and NODE_G_EXE recipes into a canned reciepe to reduce some code duplication. PR-URL: https://github.com/nodejs/node/pull/22310 Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
1 parent
36468ca928
commit
4e2fa8b0dc
1 file changed
+6
-4
@@ -90,18 +90,20 @@ help: ## Print help for targets with comments.
|
||||
# to check for changes.
|
||||
.PHONY: $(NODE_EXE) $(NODE_G_EXE)
|
||||
|
||||
define build_node_exe
|
||||
$(MAKE) -C out BUILDTYPE=$1 V=$(V)
|
||||
# The -r/-L check stops it recreating the link if it is already in place,
|
||||
# otherwise $(NODE_EXE) being a .PHONY target means it is always re-run.
|
||||
# Without the check there is a race condition between the link being deleted
|
||||
# and recreated which can break the addons build when running test-ci
|
||||
# See comments on the build-addons target for some more info
|
||||
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/$1/$(NODE_EXE) $@; fi
|
||||
endef
|
||||
$(NODE_EXE): config.gypi out/Makefile
|
||||
$(MAKE) -C out BUILDTYPE=Release V=$(V)
|
||||
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
|
||||
@$(call build_node_exe,"Release")
|
||||
|
||||
$(NODE_G_EXE): config.gypi out/Makefile
|
||||
$(MAKE) -C out BUILDTYPE=Debug V=$(V)
|
||||
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
|
||||
@$(call build_node_exe,"Debug")
|
||||
|
||||
CODE_CACHE_DIR ?= out/$(BUILDTYPE)/obj/gen
|
||||
CODE_CACHE_FILE ?= $(CODE_CACHE_DIR)/node_code_cache.cc
|
||||
|
||||
Reference in new issue
Block a user