This repository was archived by the owner on Nov 22, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (43 loc) · 1.31 KB
/
Makefile
File metadata and controls
53 lines (43 loc) · 1.31 KB
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
COLLECTD_PREFIX?=/usr/local
COLLECTD_VERSION=5.0.0
COLLECTD_SRC=work/collectd-$(COLLECTD_VERSION)
LIBTOOL=$(COLLECTD_SRC)/libtool
FETCH=fetch
CFLAGS?=-DNDEBUG -O3
all: .INIT write_graphite.la
install: all
$(LIBTOOL) --mode=install /usr/bin/install -c write_graphite.la \
$(COLLECTD_PREFIX)/lib/collectd
$(LIBTOOL) --finish \
$(COLLECTD_PREFIX)/lib/collectd
clean:
rm -rf .libs
rm -rf build
rm -f write_graphite.la
distclean: clean
rm -rf work
.INIT:
mkdir -p build
mkdir -p work
( if [ ! -d $(COLLECTD_SRC)/src ] ; then \
if which fetch ; then \
DOWNLOAD_TOOL=`which fetch` ; \
elif which wget ; then \
DOWNLOAD_TOOL=`which wget` ; \
fi ; \
cd work ; \
$${DOWNLOAD_TOOL} http://collectd.org/files/collectd-$(COLLECTD_VERSION).tar.gz ; \
tar zxvf collectd-$(COLLECTD_VERSION).tar.gz ; \
cd collectd-$(COLLECTD_VERSION) ; \
if [ ! -f libtool ] ; then \
./configure ; \
fi ; \
fi )
write_graphite.la: build/write_graphite.lo
$(LIBTOOL) --tag=CC --mode=link gcc -Wall -Werror $(CFLAGS) -module \
-avoid-version -o $@ -rpath $(COLLECTD_PREFIX)/lib/collectd \
-lpthread build/write_graphite.lo
build/write_graphite.lo: src/write_graphite.c
$(LIBTOOL) --mode=compile gcc -DHAVE_CONFIG_H -I src \
-I $(COLLECTD_SRC)/src -Wall -Werror $(CFLAGS) -MD -MP -c \
-o $@ src/write_graphite.c