-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (45 loc) · 1.33 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
EXAMPLES=webpass hackernews nena hodor discordia
.PHONY: build test examples clean fmt
all: build test
build:
go build
cd cmd/police && go build
# go build ./cmd/...
test: build
go test ./... --cover
examples: build
for e in $(EXAMPLES) ; do (cd examples/$$e && echo $$e: && go run *.go ) ; done
# include examples from police so we know its working...
go run cmd/police/main.go -sep ", " "Hello" "{{set sep=' ' data='Kitty World Dolly goodbye'}}!"
go run cmd/police/main.go -lsep ":" "{{random min=0 max=255 count=8 format=%02x}}"
clean:
go clean
for e in $(EXAMPLES) ; do (cd examples/$$e && go clean ) ; done
rm -rf parts prime stage snap police_*.snap
rm -f *.snap.xdelta3
fmt:
go fmt ./...
.PHONY: report
report:
-go install github.com/client9/misspell/cmd/misspell
-go install github.com/fzipp/gocyclo/cmd/gocyclo
-misspell *.go lib
-gocyclo -top 15 -avg .
-go vet
# ---- snaps ----
SNAPTARGETS = amd64 arm64 armhf # ppc64 i686
SNAPCRAFT=snapcraft --use-lxd --debug
.PHONY: snap
snap:
make clean
make build
make test
$(SNAPCRAFT)
$(SNAPCRAFT) login
$(SNAPCRAFT) push --release edge,beta *.snap
$(SNAPCRAFT) logout
snapcraft clean # remove new garbage
-lxc delete -f snapcraft-police
snap-setup:
sudo snap install snapcraft #multipass
# sudo apt install -y binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabihf