2023-03-25 14:07:47 +00:00
|
|
|
SHELL := bash
|
|
|
|
.ONESHELL:
|
|
|
|
.SHELLFLAGS := -eu -o pipefail -c
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
MAKEFLAGS += --warn-undefined-variables
|
|
|
|
MAKEFLAGS += --no-builtin-rules
|
2023-04-19 20:35:26 +00:00
|
|
|
TESTJOBS := 4
|
|
|
|
OS:=$(shell uname -s)
|
2023-04-21 02:53:17 +00:00
|
|
|
RELEASEFLAGS :=
|
2023-04-19 20:35:26 +00:00
|
|
|
|
|
|
|
ifeq ($(OS),Linux)
|
|
|
|
TESTJOBS:=$(shell nproc)
|
2023-04-21 02:53:17 +00:00
|
|
|
RELEASEFLAGS=--target x86_64-unknown-linux-musl
|
|
|
|
endif
|
|
|
|
ifeq ($(OS),FreeBSD)
|
|
|
|
TESTJOBS:=$(shell sysctl -n hw.ncpu)
|
2023-04-19 20:35:26 +00:00
|
|
|
endif
|
2023-03-25 14:07:47 +00:00
|
|
|
|
|
|
|
ifeq ($(origin .RECIPEPREFIX), undefined)
|
|
|
|
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
|
|
|
|
endif
|
|
|
|
.RECIPEPREFIX = >
|
|
|
|
|
|
|
|
.PHONY: build
|
2023-03-25 18:10:22 +00:00
|
|
|
build:
|
|
|
|
> cargo build
|
2023-03-25 14:07:47 +00:00
|
|
|
|
2023-04-19 04:09:25 +00:00
|
|
|
.PHONY: release
|
|
|
|
release:
|
2023-04-21 02:53:17 +00:00
|
|
|
> cargo build --release $(RELEASEFLAGS)
|
2023-04-19 04:09:25 +00:00
|
|
|
|
2023-03-25 14:07:47 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
> cargo clean
|
|
|
|
|
2023-03-25 18:10:22 +00:00
|
|
|
.PHONY: test
|
|
|
|
test:
|
2023-04-19 20:35:26 +00:00
|
|
|
> cargo test --lib --test test_loader -- --test-threads $(TESTJOBS)
|
2023-04-19 02:38:18 +00:00
|
|
|
|
|
|
|
.PHONY: integrationtest
|
|
|
|
integrationtest:
|
2023-04-19 20:35:26 +00:00
|
|
|
> cargo test --no-fail-fast --test test_loader -- --test-threads $(TESTJOBS)
|
2023-03-25 18:10:22 +00:00
|
|
|
|
2023-04-19 19:29:46 +00:00
|
|
|
.PHONY: unittest
|
|
|
|
unittest:
|
2023-04-19 20:35:26 +00:00
|
|
|
> cargo test --lib -- --test-threads $(TESTJOBS)
|
2023-04-19 19:29:46 +00:00
|
|
|
|
2023-03-25 14:07:47 +00:00
|
|
|
.PHONY: jaeger
|
|
|
|
jaeger:
|
2023-08-10 22:51:16 +00:00
|
|
|
> docker run -d --rm --name organicdocker -p 6831:6831/udp -p 6832:6832/udp -p 16686:16686 -p 14268:14268 jaegertracing/all-in-one:latest
|
2023-03-25 21:00:56 +00:00
|
|
|
|
|
|
|
.PHONY: jaegerweb
|
|
|
|
jaegerweb:
|
|
|
|
> xdg-open 'http://localhost:16686'
|
|
|
|
|
|
|
|
.PHONY: jaegerstop
|
|
|
|
jaegerstop:
|
2023-08-10 22:51:16 +00:00
|
|
|
> docker stop organicdocker
|