* the contents of INCLUDES and DEFINES should now be placed into CPPFLAGS
[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
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 ($(ARCH),x86_64)
23 GENERATE_PIC = true
24 endif
25 ifeq ($(ARCH),alpha)
26 GENERATE_PIC = true
27 endif
28
29 ifdef GENERATE_PIC
30 CFLAGS +=       -fPIC
31 LDFLAGS +=      -fPIC
32 endif
33
34 OS_LIB_PTHREAD = -lpthread
35 OS_LIB_DYNLOAD = -ldl
36
37 # Local Variables:
38 # mode: makefile
39 # End: