From 4f00562ef093833c54698ea0bc60a5d2522a2b38 Mon Sep 17 00:00:00 2001 From: Kenny Yuan Date: Fri, 13 Jul 2018 15:00:19 +0800 Subject: [PATCH] build: add new benchmark targets Adding new build targets: 'bench-addons' & 'bench-addons-clean'. With these two, it will be easier to manage the dependencies among targets and easier to build/clean the addons which are being used in benchmarking. PR-URL: https://github.com/nodejs/node/pull/20905 Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen --- Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cb9edb125241b0..0fe18f5dfc6d50 100644 --- a/Makefile +++ b/Makefile @@ -141,6 +141,7 @@ clean: ## Remove build artifacts. $(RM) -r test/tmp* $(RM) -r test/.tmp* $(MAKE) test-addons-clean + $(MAKE) bench-addons-clean .PHONY: distclean distclean: @@ -1054,13 +1055,23 @@ ifeq ($(XZ), 0) endif .PHONY: bench-all -bench-all: +bench-all: bench-addons-build @echo "Please use benchmark/run.js or benchmark/compare.js to run the benchmarks." .PHONY: bench -bench: +bench: bench-addons-build @echo "Please use benchmark/run.js or benchmark/compare.js to run the benchmarks." +# Build required addons for benchmark before running it. +.PHONY: bench-addons-build +bench-addons-build: benchmark/napi/function_call/build/Release/binding.node \ + benchmark/napi/function_args/build/Release/binding.node + +.PHONY: bench-addons-clean +bench-addons-clean: + $(RM) -r benchmark/napi/function_call/build + $(RM) -r benchmark/napi/function_args/build + .PHONY: lint-md-clean lint-md-clean: $(RM) -r tools/remark-cli/node_modules