-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (41 loc) · 1.27 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
SHORT_PACKAGE=rmproxy
PACKAGE=github.com/kwkoo/broadlinkrm
BASE:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
COVERAGEOUTPUT=coverage.out
COVERAGEHTML=coverage.html
IMAGENAME="kwkoo/golang_broadlink_rm"
VERSION="0.1"
.PHONY: build clean test coverage run image runcontainer
build:
@echo "Building..."
@cd $(BASE)/src && go build -o $(BASE)/bin/$(SHORT_PACKAGE) \
$(PACKAGE)/cmd/$(SHORT_PACKAGE)
clean:
rm -f $(BASE)/bin/$(SHORT_PACKAGE)
rundemo:
@cd $(BASE)/src && go run cmd/demo/main.go
runrmproxy:
@cd $(BASE)/src && go run \
cmd/$(SHORT_PACKAGE)/main.go \
-key 123 \
-rooms $(BASE)/../localremote/json/rooms.json \
-commands $(BASE)/../localremote/json/commands.json \
-macros $(BASE)/../localremote/json/macros.json \
-homeassistant $(BASE)/../localremote/json/homeassistant.json \
-deviceconfig $(BASE)/../localremote/json/devices.json \
-skipdiscovery
runmacrobuilder:
@cd $(BASE)/src && go run \
cmd/macrobuilder/main.go \
-rooms $(BASE)/../localremote/json/rooms.json \
-commands $(BASE)/../localremote/json/commands.json
image:
docker build --rm -t $(IMAGENAME):$(VERSION) $(BASE)
runcontainer:
docker run \
--rm \
-it \
--env-file $(BASE)/env.list \
--name $(SHORT_PACKAGE) \
-p 8080:8080 \
$(IMAGENAME):$(VERSION) \