diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2020-06-17 12:11:09 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2020-06-22 08:24:51 +0300 |
commit | 122038c6a2334a3da8ffbaa824bb3c3f61ab8197 (patch) | |
tree | b977211b476376fff11948f4429c26d0080fc6c7 /Makefile | |
parent | 07b2ada00decf1dacd49e76370d9e4a4d929de92 (diff) |
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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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) |