-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (47 loc) · 2.92 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
GIT ?= git
GO_VARS ?=
GO ?= go
COMMIT := $(shell $(GIT) rev-parse HEAD)
VERSION ?= $(shell $(GIT) describe --tags ${COMMIT} 2> /dev/null || echo "$(COMMIT)")
BUILD_TIME := $(shell LANG=en_US date +"%F_%T_%z")
ROOT := .
LD_FLAGS := -X $(ROOT).Version=$(VERSION) -X $(ROOT).Commit=$(COMMIT) -X $(ROOT).BuildTime=$(BUILD_TIME)
GOBIN ?= ./bin
.PHONY: help clean
help:
@echo "Please use \`make <ROOT>' where <ROOT> is one of"
@echo " dependencies to go install the dependencies"
@echo " hellocustosworld to build best example of nute usage"
@echo " test to run unittests"
depend:
go mod tidy
clean:
rm -f bin
helloworldgio: */*.go */*/*.go */*/*/*.go
$(GO_VARS) $(GO) build -tags "gioboot" -o="$(ROOT)/examples/helloworld/bin/hellogio" -ldflags="$(LD_FLAGS)" $(ROOT)/examples/helloworld/hellogio/main.go
$(GO_VARS) $(GO) build -tags "g3nboot" -o="$(ROOT)/examples/helloworld/bin/worldg3n" -ldflags="$(LD_FLAGS)" $(ROOT)/g3nd/worldg3n/main.go
hellofyne: */*.go */*/*.go */*/*/*.go
$(GO_VARS) $(GO) build -tags "fyneboot" -o="$(ROOT)/examples/helloworld/bin/hellofyne" -ldflags="$(LD_FLAGS)" $(ROOT)/examples/helloworld/hellofyne/main.go
hellofyneworld: */*.go */*/*.go */*/*/*.go
$(GO_VARS) $(GO) build -tags "fyneboot" -o="$(ROOT)/examples/helloworld/bin/hellofyne" -ldflags="$(LD_FLAGS)" $(ROOT)/examples/helloworld/hellofyne/main.go
$(GO_VARS) $(GO) build -tags "g3nboot" -o="$(ROOT)/examples/helloworld/bin/worldg3n" -ldflags="$(LD_FLAGS)" $(ROOT)/g3nd/worldg3n/main.go
hellocustos: */*.go */*/*.go */*/*/*.go
$(GO_VARS) $(GO) build -tags "fyneboot" -o="$(ROOT)/examples/helloworld/bin/custos" -ldflags="$(LD_FLAGS)" $(ROOT)/examples/helloworld/hellocustos/main.go
hellocustosworld: */*.go */*/*.go */*/*/*.go
$(GO_VARS) $(GO) build -tags "fyneboot" -o="$(ROOT)/examples/helloworld/bin/custos" -ldflags="$(LD_FLAGS)" $(ROOT)/examples/helloworld/hellocustos/main.go
$(GO_VARS) $(GO) build -tags "g3nboot" -o="$(ROOT)/examples/helloworld/bin/worldg3n" -ldflags="$(LD_FLAGS)" $(ROOT)/g3nd/worldg3n/main.go
worldg3n: */*.go */*/*.go */*/*/*.go
$(GO_VARS) $(GO) build -tags "g3nboot" -o="$(ROOT)/examples/helloworld/bin/worldg3n" -ldflags="$(LD_FLAGS)" $(ROOT)/g3nd/worldg3n/main.go
# In disrepair...
# helloworldmobile: */*.go */*/*.go */*/*/*.go
# $(GO_VARS) $(GO) build -o="$(ROOT)/examples/helloworld/bin/hellomobile" -ldflags="$(LD_FLAGS)" $(ROOT)/examples/helloworld/hellogio/main.go
# $(GO_VARS) $(GO) build -o="$(ROOT)/examples/helloworld/bin/worldg3n" -ldflags="$(LD_FLAGS)" $(ROOT)/examples/helloworld/worldmobile/main.go
cleanmsdk:
rm mashupsdk/mashupsdk_grpc.pb.go; rm mashupsdk/mashupsdk.pb.go
mashupsdk: */*.proto
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative mashupsdk/mashupsdk.proto
nute: *.go */*.go */*/*.go
$(GO_VARS) $(GO) build -o="$(GOBIN)/nute" -ldflags="$(LD_FLAGS)" $(ROOT)/main.go
test: *.go */*.go */*/*.go
$(GO_VARS) $(GO) test -v .
$(GO_VARS) $(GO) test -v ./tests