7e9c08eadf1c2592d5df87361a9de3a0ce631db0
[olsrd.git] / make / Makefile.linux
1 #
2 # LINUX SPECIFIC CONFIGURATION
3 #
4
5 ARCH := $(shell uname -m)
6 DESTDIR ?=
7 LIBDIR =        $(DESTDIR)/usr/lib
8 ifeq ($(strip $(ARCH)),x86_64)
9   LIB64DIR := $(shell test -d "/usr/lib64" && echo "YES")
10   ifeq ($(strip $(LIB64DIR)),YES)
11     LIBDIR = $(DESTDIR)/usr/lib64
12   endif
13 endif
14
15 SRCS +=         $(wildcard src/linux/*.c src/unix/*.c)
16 HDRS +=         $(wildcard src/linux/*.h src/unix/*.h)
17
18 CPPFLAGS +=     -Dlinux
19 LIBS +=         
20
21 PLUGIN_SONAME ?= lib$(PLUGIN_NAME).so
22 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
23 INSTALL_LIB =   install -D -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
24                 /sbin/ldconfig -n $(LIBDIR)
25 UNINSTALL_LIB = rm -f $(LIBDIR)/$(PLUGIN_FULLNAME); \
26                 /sbin/ldconfig -n $(LIBDIR)
27
28 ifdef OLSRD_PLUGIN
29 GENERATE_PIC = true
30 endif
31 ifeq ($(filter-out mips mips64 alpha x86_64 parisc64 ia64, $(ARCH)),)
32 GENERATE_PIC = true
33 endif
34
35 ifdef GENERATE_PIC
36 CFLAGS +=       -fPIC
37 LDFLAGS +=      -fPIC
38 endif
39
40 OS_LIB_PTHREAD = -lpthread
41 OS_CFLAG_PTHREAD = -pthread
42 OS_LIB_DYNLOAD = -ldl
43
44 # Local Variables:
45 # mode: makefile
46 # End: