Skip to content

Commit ebb2fb8

Browse files
danbevcodebytere
authored andcommitted
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: #33925 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d9c78ac commit ebb2fb8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Makefile

+6-7
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,12 @@ help: ## Print help for targets with comments.
9898
# and recreated which can break the addons build when running test-ci
9999
# See comments on the build-addons target for some more info
100100
ifeq ($(BUILD_WITH), make)
101-
$(NODE_EXE): config.gypi out/Makefile
102-
$(MAKE) -C out BUILDTYPE=Release V=$(V)
103-
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
104-
105-
$(NODE_G_EXE): config.gypi out/Makefile
106-
$(MAKE) -C out BUILDTYPE=Debug V=$(V)
107-
if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
101+
$(NODE_EXE): build_type:=Release
102+
$(NODE_G_EXE): build_type:=Debug
103+
$(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile
104+
$(MAKE) -C out BUILDTYPE=${build_type} V=$(V)
105+
if [ ! -r $@ -o ! -L $@ ]; then \
106+
ln -fs out/${build_type}/$(NODE_EXE) $@; fi
108107
else
109108
ifeq ($(BUILD_WITH), ninja)
110109
ifeq ($(V),1)

0 commit comments

Comments
 (0)