-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
executable file
·62 lines (56 loc) · 3.17 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
GOPATH=~/workspace/go:$(shell pwd)/vendor:$(shell pwd)
GOBIN=$(shell pwd)/bin
GOFILES=$(wildcard *.go)
ifeq ($(GOOS),) # Check if GOOS is already set
GOOS:=$(shell echo $(shell uname -s) | tr '[A-Z]' '[a-z]' | tr -d '[:space:]')
endif
$(info GOOS:$(GOOS))
ifeq ($(GOOS),darwin)
ifeq ($(shell echo $(shell uname -m) | tr '[A-Z]' '[a-z]'), arm64e) # Check for 32-bit ARM (armv7l)
GOARCH := arm64
else
GOARCH := amd64
endif
else ifeq ($(GOOS),linux)
ifeq ($(shell echo $(shell uname -m) | tr '[A-Z]' '[a-z]'), armv7l) # Check for 32-bit ARM (armv7l)
GOARCH := arm
else ifeq ($(shell echo $(shell uname -m) | tr '[A-Z]' '[a-z]'),aarch64)
GOARCH := arm64
else
GOARCH := amd64 # Assuming 64-bit AMD64 by default for Linux
endif
else
$(error Unsupported GOOS: $(GOOS))
endif
$(info GOARCH: $(GOARCH))
apiprod:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go install -tags "trcname prod" -a -ldflags '-w' github.com/trimble-oss/tierceron/trcweb/apiRouter
api:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install github.com/trimble-oss/tierceron/trcweb/apiRouter
fiddler:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -tags "azure memonly" github.com/trimble-oss/tierceron/cmd/trcfiddler
config:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -buildmode=pie -tags "azure memonly" github.com/trimble-oss/tierceron/cmd/trcconfig
configwin:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=windows GOARCH=amd64 go build -tags "windows azure memonly" -o $(GOBIN)/trcconfig.exe github.com/trimble-oss/tierceron/cmd/trcconfig
seed:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -tags "azure memonly" github.com/trimble-oss/tierceron/cmd/trcinit
seedp:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH)go install -tags "azure memonly" github.com/trimble-oss/tierceron/cmdp/trcinitp
x:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -buildmode=pie -tags "azure memonly" github.com/trimble-oss/tierceron/cmd/trcx
xlib:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -buildmode=c-shared -a -ldflags '-w' -tags "azure memonly" -o $(GOBIN)/nc.so github.com/trimble-oss/tierceron/zeroconfiglib
maclib:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) CGO_ENABLED=1 GOOS=darwin GOARCH=$(GOARCH) go build -buildmode=c-shared -tags "azure" -o $(GOBIN)/nc.dylib github.com/trimble-oss/tierceron/zeroconfiglib
xp:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -tags "azure memonly" github.com/trimble-oss/tierceron/cmdp/trcxp
pub:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -tags "azure memonly" github.com/trimble-oss/tierceron/cmd/trcpub
sub:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -tags "azure memonly" github.com/trimble-oss/tierceron/cmd/trcsub
ctl:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) GOOS=$(GOOS) GOARCH=$(GOARCH) go install -buildmode=pie -tags "memonly tc" github.com/trimble-oss/tierceron/cmd/trcctl
gen:
protoc --proto_path=. --twirp_out=. --go_out=. rpc/apinator/service.proto
all: api config seed x xlib pub sub