-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
56 lines (45 loc) · 1.06 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
CARGO_BIN ?= `which cargo`
TARGET_PATH ?= `pwd`/target/release
BIN_VERSION ?= 0.1.1
BIN_NAME ?= awsudo
BIN_PATH ?= $(TARGET_PATH)/$(BIN_NAME)
NPM ?= `which npm`
MERMAID ?= `which mmdc`
DOCS_PATH ?= `pwd`/docs
RELEASE_FILE ?= $(BIN_NAME)-$(BIN_VERSION).x86_64-apple-darwin.tar.gz
FUNZZY_BIN ?= `which funzzy`
COMPOSE ?= `which docker-compose`
.PHONY: build
build: format
@$(CARGO_BIN) build
.PHONY: build_release
build_release: format
@$(CARGO_BIN) build --release
.PHONY: format
format:
@$(CARGO_BIN) fmt
.PHONY: run
run: build
@$(BIN_PATH)
.PHONY: install
install: build_release
$(CARGO_BIN) install --force
.PHONY: test
test: format
@$(CARGO_BIN) test
.PHONY: setup_docs
setup_docs:
@$(NPM) install -g mermaid.cli
.PHONY: docs
docs:
@$(MERMAID) -i $(DOCS_PATH)/workflow.mmd -o $(DOCS_PATH)/workflow.png -t neutral
.PHONY: release
release: build_release
@cd $(TARGET_PATH) && tar -zcvf ../../$(RELEASE_FILE) $(BIN_NAME)
@shasum -a 256 $(RELEASE_FILE)
.PHONY: test_watcher
test_watcher:
@$(FUNZZY_BIN)
.PHONY: docker_test_watcher
docker_test_watcher:
@$(COMPOSE) up