1 # The olsr.org Optimized Link-State Routing daemon(olsrd)
2 # Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in
13 # the documentation and/or other materials provided with the
15 # * Neither the name of olsr.org, olsrd nor the names of its
16 # contributors may be used to endorse or promote products derived
17 # from this software without specific prior written permission.
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
32 # Visit http://www.olsr.org for more information.
34 # If you find this software useful feel free to make a donation
35 # to the project. For more information see the website or contact
36 # the copyright holders.
38 # $Id: Makefile,v 1.9 2005/03/01 21:41:34 tlopatic Exp $
40 PLUGIN_NAME = olsrd_nameservice
46 # default CFLAGS and LDFLAGS, used if not externally set
48 # used for compilation: yes
49 # used for dependency file generation: no
51 CFLAGS_SET = -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes
54 # always appended to default or externally set CFLAGS and LDFLAGS
56 # used for compilation: yes
57 # used for dependency file generation: yes
59 CFLAGS_ADD = -DOLSR_PLUGIN -I../../src
60 LDFLAGS_ADD = -Wall -shared -Wl,--version-script=version-script.txt
62 # same as CFLAGS_ADD, but not used for dependency file generation
64 # used for compilation: yes
65 # used for dependency file generation: no
67 CFLAGS_ADD2 = # nothing
71 SRCS = $(wildcard src/*.c)
72 OBJS = $(patsubst %.c,%.o,$(SRCS))
73 HDRS = $(wildcard src/*.c)
83 NAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
87 LDFLAGS_ADD += -fPIC -Wl,-soname,$(NAME)
89 CFLAGS_SET += # nothing
90 LDFLAGS_SET += # nothing
94 LIBDIR ?= $(INSTALL_PREFIX)/usr/lib
96 INSTALL_LIB = install -D -m 755 $(NAME) $(LIBDIR)/$(NAME); \
97 /sbin/ldconfig -n $(LIBDIR)
99 EXTRA_OBJS = # nothing
101 MAKEDEPEND = makedepend -f $(DEPFILE) $(CFLAGS_ADD) -Y $(INCLUDES) \
102 $(SRCS) >/dev/null 2>&1
111 NAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
113 CFLAGS_ADD += # nothing
115 LDFLAGS_ADD += -fPIC -Wl,-soname,$(NAME)
117 CFLAGS_SET += # nothing
118 LDFLAGS_SET += # nothing
122 LIBDIR ?= $(INSTALL_PREFIX)/usr/lib
124 INSTALL_LIB = install -m 755 $(NAME) $(LIBDIR)/$(NAME); \
127 EXTRA_OBJS = # nothing
129 MAKEDEPEND = makedepend -f $(DEPFILE) $(CFLAGS_ADD) $(INCLUDES) $(SRCS)
138 NAME ?= $(PLUGIN_NAME).dll
140 CFLAGS_ADD += -mno-cygwin -I../../src/win32 -DWIN32
141 CFLAGS_ADD2 += # nothing
142 LDFLAGS_ADD += -mno-cygwin -Wl,-soname,$(NAME)
144 CFLAGS_SET += # nothing
145 LDFLAGS_SET += # nothing
149 INSTALL_LIB = cp $(NAME) ../..
151 EXTRA_OBJS = ../../src/win32/compat.o
153 MAKEDEPEND = makedepend -f $(DEPFILE) $(CFLAGS_ADD) $(INCLUDES) $(SRCS)
169 CFLAGS ?= $(CFLAGS_SET)
170 LDFLAGS ?= $(LDFLAGS_SET)
172 CFLAGS += $(CFLAGS_ADD) $(CFLAGS_ADD2)
173 LDFLAGS += $(LDFLAGS_ADD)
177 $(NAME): $(OBJS) $(EXTRA_OBJS)
178 $(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(EXTRA_OBJS) $(LIBS)
185 rm -f $(OBJS) $(NAME) $(DEPFILE)
187 $(DEPFILE): $(SRCS) $(HDRS)
189 echo "# Generated automatically. DO NOT EDIT." >$(DEPFILE)
195 @echo ' * * * * olsr.org Plugin Make * * * *'
197 @echo ' Plugin: $(PLUGIN_NAME), version $(PLUGIN_VER)'
199 @echo ' You must provide a valid target OS by setting the OS variable.'
201 @echo ' Valid settings are:'
203 @echo ' linux - GNU/Linux'
204 @echo ' win32 - Microsoft Windows'
205 @echo ' fbsd - FreeBSD'
207 @echo ' Example - Build on Windows:'
209 @echo ' make OS=win32'
211 @echo ' Example - Build and install on Linux:'
213 @echo ' make OS=linux install '