forked from davepl/Primes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (22 loc) · 1.04 KB
/
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
27
28
29
30
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-cc-works check-docker-works check-node-works
.PHONY: check-cc-works
check-cc-works:
@cc --version >/dev/null 2>&1 || (echo 'Please install a C compiler. See https://github.com/PlummersSoftwareLLC/Primes/blob/drag-race/BENCHMARK.md for more information.' && exit 1)
.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