forked from PlummersSoftwareLLC/Primes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (19 loc) · 829 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
SHELL := /bin/bash
.ONESHELL:
DIRECTORY := $(shell pwd)
FORMATTER := "table"
.PHONY: all
all: benchmark
.PHONY: benchmark
benchmark: check-env
@REALPATH=$$(cd "$${DIRECTORY}" && pwd); cd tools/; \
npm ci --silent && npm start --silent -- benchmark -d "$${REALPATH}" -f "$(FORMATTER)"
.PHONY: check-env
check-env: check-docker-works check-node-works
.PHONY: check-node-works
check-node-works:
@npm --version >/dev/null 2>&1 || (echo 'Please install Node.js. See https://github.com/PlummersSoftwareLLC/Primes/blob/drag-race/BENCHMARK.md for more information.' && exit 1)
.PHONY: check-docker-works
check-docker-works:
@docker --version >/dev/null 2>&1 || (echo 'Please install docker. See https://github.com/PlummersSoftwareLLC/Primes/blob/drag-race/BENCHMARK.md for more information.' && exit 1)
@docker ps >/dev/null