-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (63 loc) · 1.2 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
57
58
59
60
61
62
63
64
65
66
67
68
69
# ------------
# common utils
# ------------
path_cmd := cmd
path_dist := dist
path_snippets := snippets
v_files := $(shell find -name '*.v')
$(path_dist): $(path_dist)/.keep
@:
$(path_dist)/.keep:
@mkdir -p $(path_dist)
@touch $(path_dist)/.keep
# --------
# binaries
# --------
kaico_src := $(path_cmd)/cmd_kaico
kaico_bin := $(path_dist)/kaico
$(kaico_bin): $(v_files) $(path_dist)
v -o $(kaico_bin) $(kaico_src)
# -----
# tasks
# -----
.DEFAULT_GOAL := all
.PHONY: new build run clean fmt vet lint test all
new_file_template_path := $(path_snippets)/license.vv
new: file :=
new:
cp $(new_file_template_path) $(file)
build: $(kaico_bin)
@:
run: args :=
run: build
@$(kaico_bin) $(args)
clean:
rm -r $(path_dist)
test: path := .
test:
v test $(path)
fmt: path := $(v_files)
fmt:
@v fmt -w $(path)
vet: path := $(v_files)
vet:
@v vet $(path)
lint: path := $(v_files)
lint:
@v fmt -verify $(path)
@v vet -W $(path)
all: build
@:
# ------
# docker
# ------
docker-tag := kaico/kaico-dev
docker-tag := kaico/kaico-dev
docker-build: tag := $(docker-tag)
docker-build:
docker build -t $(docker-tag) .
docker-run: tag := $(docker-tag)
docker-run: args := bash
docker-run:
echo $(args)
docker run -it $(tag) $(args)