Added nameservice plugin
[olsrd.git] / lib / nameservice / Makefile
1 CC ?= gcc
2 STRIP ?= strip
3 NAME = olsrd_nameservice.so.0.1
4 LIBDIR ?= $(INSTALL_PREFIX)/usr/lib
5 MYFLAGS = -Wall -fPIC -D_GNU_SOURCE
6 LIBS ?= -lc -lm
7 CFLAGS ?= -O2
8 CFLAGS += $(MYFLAGS)
9
10 SRCS = $(wildcard src/*.c)
11 OBJS = $(patsubst %.c,%.o,$(SRCS))
12 HDRS = $(wildcard src/*.c)
13
14 all: plugin
15
16 plugin: $(OBJS)
17         $(CC) $(LDFLAGS) $(MYFLAGS) -shared -Wl,-soname,$(NAME) \
18         -Wl,--version-script=version-script.txt \
19         -o $(NAME) $(OBJS) $(LIBS)
20
21 install:
22         $(STRIP) $(NAME)
23         install -D -m 755 $(NAME) $(LIBDIR)/$(NAME)
24         /sbin/ldconfig -n $(LIBDIR)
25
26 clean:
27         rm -f $(OBJS) $(NAME)
28
29 src/olsrd_plugin.o: $(HDRS)
30 src/nameservice.o: $(HDRS)