-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·55 lines (45 loc) · 1 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
INSTALL_PATH = /etc/telegraf/plugins/inputs/execd/query
.PHONY: help
help : Makefile
@echo "usage: make"
@echo
@echo "TARGETS:"
@sed -n 's/^## HELP://p' $<
@echo
## HELP: all Build all
.PHONY: all
all: build
@echo
@echo ALL completed
## HELP: clean Clean all
.PHONY: clean
clean:
@rm -fR ./dist
@echo
@echo CLEAN completed
build:
@go build -o ./dist/query cmd/main.go
@cp "cmd/plugin.conf" ./dist
## HELP: install Install plugin
.PHONY: install
install: build install-config install-plugin
@echo
@echo INSTALL completed
install-config:
@mkdir -p ${INSTALL_PATH};
@cp "./dist/plugin.conf" ${INSTALL_PATH};
@echo "${INSTALL_PATH}/plugin.conf"
install-plugin:
@mkdir -p ${INSTALL_PATH};
@cp "./dist/query" ${INSTALL_PATH};
@echo "${INSTALL_PATH}/query"
## HELP: run Run plugin
.PHONY: run
run: build
run:
@./dist/query --config ./dist/plugin.conf
## HELP: test Run test
.PHONY: test
test: test-plugin
test-plugin:
go test ./plugins/inputs/query/ -v