From 8046c8b5ca2f792d43d277988ad8efbc4d0ece57 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 17 Jun 2020 11:11:09 +0200 Subject: [PATCH] build: add target specific build_type variable This commit add a target specific variable named 'build_type' to the node and node_g targets. The motivation for doing this is that both targets share the same prerequisites, and the recepies are the same (apart from the build type) so some duplication can be avoided. PR-URL: https://github.com/nodejs/node/pull/33925 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 46e3b5b160498f..32a8a6c2dca732 100644 --- a/Makefile +++ b/Makefile @@ -98,13 +98,12 @@ help: ## Print help for targets with comments. # and recreated which can break the addons build when running test-ci # See comments on the build-addons target for some more info ifeq ($(BUILD_WITH), make) -$(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 - -$(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 +$(NODE_EXE): build_type:=Release +$(NODE_G_EXE): build_type:=Debug +$(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile + $(MAKE) -C out BUILDTYPE=${build_type} V=$(V) + if [ ! -r $@ -o ! -L $@ ]; then \ + ln -fs out/${build_type}/$(NODE_EXE) $@; fi else ifeq ($(BUILD_WITH), ninja) ifeq ($(V),1)