-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1009 Bytes
/
Makefile
File metadata and controls
50 lines (37 loc) · 1009 Bytes
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
dir = generated/$(shell date +%s)
host-target := $(shell grep -s 'arch:' ./cmd/modo/version-info.yaml | cut -d' ' -f2| cut -d- -f1,2)
version := $(shell grep -s 'version:' ./cmd/modo/version-info.yaml | cut -d' ' -f2 )
init:
./script/gen-version-info-yaml.sh
build:
go build -ldflags="$(shell go run ./script/gen_ldflag.go)" -o modo ./cmd/modo
clean:
rm -rf generated
rm -rf modo
rm -rf dist
rm -rf cmd/modo/version-info.yaml
rm -rf ./*.tar.gz
build-debug:
mkdir -p $(dir)
go build -a -p 1 -x -work -o ./$(dir)/modo ./cmd/modo
test-all:
make test-compiler
make test-go
test-compiler:
./script/test-lite.sh
./script/test-full.sh
test-full-compiler:
./script/test-full.sh
test-lite-compiler:
./script/test-lite.sh
test-go:
@if command -v tc >/dev/null 2>&1; then \
go test -v ./... | tc; \
else \
go test -v ./...; \
fi
dist:
mkdir -p dist/modo/bin
cp modo dist/modo/bin/
cp cmd/modo/version-info.yaml dist/modo/
tar -czf modo$(version).$(host-target).tar.gz -C dist modo