forked from AlexanderGrooff/mermaid-ascii
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (39 loc) · 1.03 KB
/
Copy pathMakefile
File metadata and controls
54 lines (39 loc) · 1.03 KB
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
PREFIX ?= /usr/local/bin
pkgname ?= mermaid-ascii
targets += $(PREFIX)/$(pkgname)
ifneq (,$(wildcard /usr/share/bash-completion/completions/))
targets += /usr/share/bash-completion/completions/$(pkgname)
endif
all: build/$(pkgname) build/completions/bash build/completions/zsh build/completions/fish
build/$(pkgname): cmd/*.go | build/
go build -o $@
.PHONY: install
install: $(targets)
$(PREFIX)/$(pkgname): build/$(pkgname) | $(PREFIX)
install -m 755 $< $@
/usr/share/bash-completion/completions/$(pkgname): build/completions/bash
install -m 755 $< $@
build/completions/%: build/$(pkgname) | build/completions/
./$< completion $(@F) > $@
%/:
mkdir -p $@
.PHONY: clean
clean:
$(RM) -r build
.PHONY: uninstall
uninstall:
$(RM) $(targets)
.PHONY: test
test:
go test ./... -v
.PHONY: docker-build
docker-build:
docker build -t mermaid-ascii:latest .
.PHONY: docker-test
docker-test:
docker build --target test -t mermaid-ascii:test -f Dockerfile.test .
.PHONY: docker-run
docker-run:
docker run -i mermaid-ascii:latest
dev:
air