-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 727 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 727 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
GO_BUILD_ENV :=
GO_BUILD_FLAGS :=
MODULE_BINARY := bin/cube-sorter
ifeq ($(VIAM_TARGET_OS), windows)
GO_BUILD_ENV += GOOS=windows GOARCH=amd64
GO_BUILD_FLAGS := -tags no_cgo
MODULE_BINARY = bin/cube-sorter.exe
endif
$(MODULE_BINARY): Makefile go.mod *.go cmd/module/*.go
GOOS=$(VIAM_BUILD_OS) GOARCH=$(VIAM_BUILD_ARCH) $(GO_BUILD_ENV) go build $(GO_BUILD_FLAGS) -o $(MODULE_BINARY) cmd/module/main.go
lint:
gofmt -s -w .
update:
go get go.viam.com/rdk@latest
go mod tidy
test:
go test ./...
module.tar.gz: meta.json $(MODULE_BINARY)
ifneq ($(VIAM_TARGET_OS), windows)
strip $(MODULE_BINARY)
endif
tar czf $@ meta.json $(MODULE_BINARY)
module: test module.tar.gz
all: test module.tar.gz
setup:
go mod tidy