-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
73 lines (57 loc) · 1.88 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
63
64
65
66
67
68
69
70
71
72
73
# SPDX-License-Identifier: GPL-3.0-or-later
PREFIX ?= /usr
LIB_DIR ?= lib
PLUGIN_DIR = ${DESTDIR}${PREFIX}/libexec/netdata/plugins.d
CONF_DIR = ${DESTDIR}${PREFIX}/${LIB_DIR}/netdata/conf.d
HEALTH_DIR = ${CONF_DIR}/health.d
VERSION = 0.13
CFLAGS ?= -O2 -pipe
CFLAGS += -Wall -pedantic
CFLAGS += -std=c11
CFLAGS += -Werror=implicit-function-declaration
CPPFLAGS += -D_GNU_SOURCE
BIN = \
qmail.plugin \
scanner.plugin \
svstat.plugin \
parser.plugin
ifdef IPMI_PLUGIN
BIN += ipmi-dcmi.plugin
endif
OBJS_COMMON = flush.o fs.o netdata.o signal.o timer.o vector.o
HEADERS_COMMON = fs.h err.h timer.h vector.h
.PHONY: all
all: $(BIN)
## Dependencies
ipmi-dcmi.plugin: LDLIBS += $(shell pkgconf --libs libfreeipmi)
ipmi-dcmi.plugin: netdata.o timer.o
ipmi-dcmi.plugin.o: CPPFLAGS += $(shell pkgconf --cflags libfreeipmi)
ipmi-dcmi.plugin.o: err.h netdata.h timer.h
qmail.plugin: qmail.plugin.o $(OBJS_COMMON) queue.o send.o smtp.o
scanner.plugin: scanner.plugin.o $(OBJS_COMMON) scanner.o
svstat.plugin: fs.o netdata.o timer.o vector.o
parser.plugin: parser.plugin.o $(OBJS_COMMON) parser.o
qmail.plugin.o: $(HEADERS_COMMON) flush.h signal.h queue.h send.h smtp.h
scanner.plugin.o: $(HEADERS_COMMON) flush.h signal.h scanner.h
svstat.plugin.o: $(HEADERS_COMMON) netdata.h
parser.plugin.o: flush.h fs.h signal.h timer.h vector.h
flush.o: flush.c flush.h
fs.o: fs.c fs.h err.h callbacks.h
netdata.o: netdata.c netdata.h
queue.o: queue.c queue.h callbacks.h netdata.h err.h fs.h
send.o: send.c send.h callbacks.h netdata.h
signal.o: signal.c signal.h
smtp.o: smtp.c smtp.h callbacks.h netdata.h
timer.o: timer.c timer.h
vector.o: vector.c vector.h err.h
parser.o: parser.c parser.h
.PHONY: install
install: all
@echo installing executables to $(PLUGIN_DIR)
install -d $(PLUGIN_DIR)
install $(BIN) $(PLUGIN_DIR)
install -d $(HEALTH_DIR)
install health.d/* $(HEALTH_DIR)
.PHONY: clean
clean:
$(RM) *.o $(BIN)