-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (26 loc) · 813 Bytes
/
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
TARGET=batman_adv
CC?=gcc
CFLAGS?=-O3 -Wall -Werror -fPIC
LIBTOOL?=libtool
COLLECTD_PREFIX?=/usr
COLLECTD_INCLUDE?=$(COLLECTD_PREFIX)/include/collectd
COLLECTD_HEADERS?=$(COLLECTD_INCLUDE)/core
all: $(TARGET).la
install: all
$(LIBTOOL) --mode=install /usr/bin/install -c $(TARGET).la \
$(COLLECTD_PREFIX)/lib/collectd
$(LIBTOOL) --finish \
$(COLLECTD_PREFIX)/lib/collectd
clean:
rm -rf .libs
rm -rf build
rm -f $(TARGET).la
$(TARGET).la: build/$(TARGET).lo
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -module \
-avoid-version -o $@ \
-rpath $(COLLECTD_PREFIX)/lib/collectd \
-lpthread build/$(TARGET).lo
build/$(TARGET).lo: src/$(TARGET).c
$(LIBTOOL) --mode=compile $(CC) -DHAVE_CONFIG_H \
-I $(COLLECTD_INCLUDE) -I $(COLLECTD_HEADERS) \
$(CFLAGS) -MD -MP -c -o $@ src/$(TARGET).c