-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.common
executable file
·46 lines (36 loc) · 1.22 KB
/
Makefile.common
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
# Go parameters
GOCMD=go
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOGENERATE=$(GOCMD) generate
PKG_CONFIG_PATH="/opt/vc/lib/pkgconfig"
# App parameters
GOPI=github.com/djthorpe/gopi
GOLDFLAGS += -X $(GOPI).GitTag=$(shell git describe --tags)
GOLDFLAGS += -X $(GOPI).GitBranch=$(shell git name-rev HEAD --name-only --always)
GOLDFLAGS += -X $(GOPI).GitHash=$(shell git rev-parse HEAD)
GOLDFLAGS += -X $(GOPI).GoBuildTime=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
GOFLAGS = -ldflags "-s -w $(GOLDFLAGS)"
all: test install
protobuf:
$(GOGENERATE) ./rpc/protobuf/...
test:
$(GOTEST) ./protocol/...
clean:
$(GOCLEAN)
mihome-client: protobuf
$(GOINSTALL) $(GOFLAGS) ./cmd/mihome-client/...
mihome-service: protobuf
PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(GOINSTALL) -tags "rpi spi" $(GOFLAGS) ./cmd/mihome-service/...
mihome-reset:
$(GOINSTALL) -tags "rpi spi" $(GOFLAGS) ./cmd/mihome-reset/...
i2c:
$(GOINSTALL) -tags "rpi i2c" ./cmd/bme280/...
$(GOINSTALL) -tags "rpi i2c" ./cmd/bme680/...
$(GOINSTALL) -tags "rpi i2c" ./cmd/tsl2561/...
$(GOINSTALL) -tags "rpi i2c" ./cmd/ads1015/...
spi:
$(GOINSTALL) -tags "rpi spi" ./cmd/bme280/...
$(GOINSTALL) -tags "rpi spi" ./cmd/bme680/...