Merge branch 'tunnel' into stable
[olsrd.git] / make / Makefile.linux
1 #
2 # LINUX SPECIFIC CONFIGURATION
3 #
4
5 ARCH := $(shell uname -m)
6 DESTDIR ?=
7 LIBDIR =        $(DESTDIR)$(shell if [ "$(ARCH)" = "x86_64" -a -d "/usr/lib64" ]; then echo "/usr/lib64"; else echo "/usr/lib"; fi)
8
9 SRCS +=         $(wildcard src/linux/*.c src/unix/*.c)
10 HDRS +=         $(wildcard src/linux/*.h src/unix/*.h)
11
12 CPPFLAGS +=     -Dlinux -DLINUX_NETLINK_ROUTING
13 LIBS +=         
14
15 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
16 INSTALL_LIB =   install -D -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
17                 /sbin/ldconfig -n $(LIBDIR)
18
19 ifdef OLSRD_PLUGIN
20 GENERATE_PIC = true
21 endif
22 ifeq ($(filter-out alpha x86_64 parisc64 ia64, $(ARCH)),)
23 GENERATE_PIC = true
24 endif
25
26 ifdef GENERATE_PIC
27 CFLAGS +=       -fPIC
28 LDFLAGS +=      -fPIC
29 endif
30
31 OS_LIB_PTHREAD = -lpthread
32 OS_CFLAG_PTHREAD = -pthread
33 OS_LIB_DYNLOAD = -ldl
34
35 # Local Variables:
36 # mode: makefile
37 # End: