-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
65 lines (49 loc) · 1.54 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
SHELL = /usr/bin/env bash -euo pipefail
BINNAME := vdm
.PHONY: %
all: ci package package-debian
ci: clean
@bash ./scripts/ci.sh
# test is just an alias for ci
test: ci
ci-container:
@docker build -f ./Containerfile -t vdm-test:latest .
test-coverage: test
go tool cover -html=./cover.out -o cover.html
xdg-open ./cover.html
# builds for the current platform only
build: clean
@go build -buildmode=pie -o build/$$(go env GOOS)-$$(go env GOARCH)/$(BINNAME) -ldflags "-s -w"
xbuild: clean
@bash ./scripts/xbuild.sh
package: xbuild
@bash ./scripts/package.sh
package-debian: build
@bash ./scripts/package-debian.sh
clean:
@rm -rf \
/tmp/$(BINNAME)-tests \
*cache* \
.*cache* \
./build/ \
./dist/zipped/*.tar.gz \
./dist/zipped/*.zip \
./dist/debian/vdm.deb \
*.out
@sudo rm -rf ./dist/debian/vdm/usr
# TODO: until I sort out the tests to write test data consistently, these deps/
# directories etc. can kind of show up anywhere
@find . -type d -name '*deps*' -exec rm -rf {} +
@find . -type f -name '*VDMMETA*' -delete
bump-versions: clean
@bash ./scripts/bump-versions.sh "$${old_version:-}"
tag-release: clean
@bash ./scripts/tag-release.sh
pre-commit-hook:
cp ./scripts/ci.sh ./.git/hooks/pre-commit
# Some targets that help set up local workstations with rhad tooling. Assumes
# ~/.local/bin is on $PATH
add-local-symlinks:
@mkdir -p "$${HOME}"/.local/bin
@ln -fs $$(realpath build/$$(go env GOOS)-$$(go env GOARCH)/$(BINNAME)) "$${HOME}"/.local/bin/$(BINNAME)
@printf 'Symlinked vdm to %s\n' "$${HOME}"/.local/bin/$(BINNAME)