print interface defaults prior to interaces on startupwq
[olsrd.git] / make / Makefile.android
1 #
2 # LINUX SPECIFIC CONFIGURATION
3 #
4
5 PREFIX ?= /data/local
6 SBINDIR = $(PREFIX)/bin
7 ETCDIR = $(PREFIX)/etc
8 LIBDIR = $(PREFIX)/lib
9 DOCDIR =
10 MANDIR =
11
12 SRCS +=         $(wildcard src/linux/*.c src/unix/*.c)
13 HDRS +=         $(wildcard src/linux/*.h src/unix/*.h)
14
15 CPPFLAGS +=     -Dlinux
16 CPPFLAGS +=     -Dandroid
17 CPPFLAGS +=     -DINET_ADDRSTRLEN=16
18 CPPFLAGS +=     -Dipv6mr_interface=ipv6mr_ifindex
19 CPPFLAGS +=     -D'IPTOS_PREC(tos)=((tos)&0xe0)'
20 CPPFLAGS +=     -D'IPTOS_TOS(tos)=((tos)&0x1e)'
21 CPPFLAGS +=     -DOLSRD_GLOBAL_CONF_FILE=\"$(CFGFILE)\"
22
23 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
24 INSTALL_LIB =   install -D -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
25                 /sbin/ldconfig -n $(LIBDIR)
26
27 ifdef OLSRD_PLUGIN
28 GENERATE_PIC = true
29 endif
30
31 ifdef GENERATE_PIC
32 CFLAGS +=       -fPIC
33 LDFLAGS +=      -fPIC
34 endif
35
36 # You need to download and extract the Android NDK from
37 # http://developer.android.com/sdk/ndk/1.5_r1/index.html
38
39 NDK = /usr/src/android-ndk-1.5_r1
40 NDK_ARCH = $(NDK)/build/platforms/android-1.5/arch-arm
41
42 ifneq ($(shell uname -m),armv6l)
43 # You are not compiling with Debian direct on the phone
44 CROSS_COMPILE = $(NDK)/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin/arm-eabi-
45 CC = $(CROSS_COMPILE)gcc
46 endif
47
48 CFLAGS += -I$(NDK_ARCH)/usr/include
49
50 LDFLAGS += -nostartfiles -nodefaultlibs -nostdlib
51 LDFLAGS += -Wl,--dynamic-linker -Wl,/system/bin/linker
52 LDFLAGS += -Wl,-L$(NDK_ARCH)/usr/lib
53 LDFLAGS += -Wl,-rpath-link -Wl,$(NDK_ARCH)/usr/lib
54 ifndef OLSRD_PLUGIN
55 LDFLAGS += $(NDK_ARCH)/usr/lib/crtbegin_dynamic.o
56 endif
57
58 LIBS += -Wl,-lc -Wl,-lm -Wl,-lgcc
59 ifndef OLSRD_PLUGIN
60 LIBS += $(NDK_ARCH)/usr/lib/crtend_android.o
61 endif
62
63 # Local Variables:
64 # mode: makefile
65 # End: