Skip to content

Commit

Permalink
build: add target specific build_type variable
Browse files Browse the repository at this point in the history
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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and codebytere committed Jul 12, 2020
1 parent 732b80b commit d77eaee
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d77eaee

Please sign in to comment.