-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1.02 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
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
GOARCH ?= amd64
GOOS ?= linux
endif
ifeq ($(UNAME_S),Darwin)
GOARCH ?= amd64
GOOS ?= darwin
endif
GO ?= env GOOS=$(GOOS) GOARCH=$(GOARCH) go
GOFLAGS ?=
BUILD ?= $(abspath build)
BUILDARCH ?= $(BUILD)/$(GOOS)-$(GOARCH)
default:
$(MAKE) binaries-all
build:
GOOS=linux GOARCH=amd64 $(MAKE) binaries-all
GOOS=linux GOARCH=arm $(MAKE) binaries-all
GOOS=darwin GOARCH=amd64 $(MAKE) binaries-all
rebuild:
go get github.com/fieldkit/app-protocol
go get github.com/fieldkit/data-protocol
go get github.com/fieldkit/atlas-protocol
GOOS=linux GOARCH=amd64 GOFLAGS=-a $(MAKE) binaries-all
GOOS=linux GOARCH=arm GOFLAGS=-a $(MAKE) binaries-all
GOOS=darwin GOARCH=amd64 GOFLAGS=-a $(MAKE) binaries-all
ci: rebuild
all: rebuild
binaries-all: $(BUILDARCH)/fake-device
$(BUILDARCH)/fake-device: *.go
$(GO) build $(GOFLAGS) -o $(BUILDARCH)/fake-device *.go
clean:
rm -rf $(BUILD)
run: build
$(BUILDARCH)/fake-device
no-modules: build
$(BUILDARCH)/fake-device --no-modules
.PHONY: build