2 #############################################
3 # EXAMPLE MAKEFILE TO CREATE A OLSRD PLUGIN #
4 #############################################
6 #Alter this file to fit your needs
9 NAME ?= olsrd_power.so.0.1
10 LIBDIR ?= $(INSTALL_PREFIX)/usr/lib
11 # -fPIC creates position independent code
12 MYFLAGS ?= -Wall -fPIC -g # Uncomment -g for debugging
17 SRCS= src/olsrd_plugin.c src/olsrd_power.c
21 OBJS= src/olsrd_plugin.o src/olsrd_power.o
25 HDRS= src/olsrd_plugin.h src/olsrd_power.h
27 # -Wl passes options to the linker(-soname,....)
28 # Use -lc to link it against C library
29 # not 100% sure if this is neccesary
35 $(CC) $(LDFLAGS) $(MYFLAGS) -g -shared -Wl,-soname,$(NAME) \
36 -o $(NAME) $(OBJS) $(LIBS)
40 install -D -m 755 $(NAME) $(LIBDIR)/$(NAME)
41 /sbin/ldconfig -n $(LIBDIR)