Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 129 lines (89 sloc) 4.408 kB
#
# To select what platform the FINS source should be built for, uncomment the appropriate line below
# ONLY ONE MAY BE UNCOMMENTED AT ONCE!
#
#BUILD_FOR_ANDROID_ARM := "If uncommented, the FINS source will build for android arch-ARM."
#BUILD_FOR_ANDROID_X86 := "If uncommented, the FINS source will build for android arch-x86"
BUILD_FOR_LINUX := "If uncommented, the FINS source will build for linux"
###### Common stuff ######
TRUNK_DIR := $(FINS_ROOT_DIR)/trunk
OBJ_DIR := $(FINS_ROOT_DIR)/obj
EXECS_DIR := $(TRUNK_DIR)/execs
LIBS_DIR := $(TRUNK_DIR)/libs
MODULES_DIR := $(TRUNK_DIR)/modules
MAX_DEPTH := 10
filter_headers = $(shell ls $(1) 2> /dev/null | grep \\.h)
filter_headers_path = $(foreach DIR,$(1),$(addprefix $(DIR)/,$(call filter_headers,$(DIR))))
###### build for android (arch arm) ######
ifdef BUILD_FOR_ANDROID_ARM
TARGET_PLATFORM := "Android arch-ARM"
ARCH := arm
FOLDER_LIST := trunk #tests
EXECS_LIST := capturer console launcher wedge
#core can compile/run but doesn't work, stops when main thread loses focus?
NDK_PLATFORM_VER := 14
ANDROID_NDK_ROOT := /opt/android/android-ndk-r8e
PREBUILT_ROOT := /opt/android/prebuilt
USR := $(ANDROID_NDK_ROOT)/platforms/android-$(NDK_PLATFORM_VER)/arch-arm/usr
#BIN := $(PREBUILT_ROOT)/linux-x86/toolchain/arm-eabi-4.4.3/bin
BIN := $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin
#signals using a different system & not to set the values of CC, LD, CFLAGS, LDFLAGS
ifndef ALTERNATIVE_BUILD
#CC := $(BIN)/arm-eabi-gcc
CC = $(BIN)/arm-linux-androideabi-gcc
CCOPTS := -DBUILD_FOR_ANDROID
CCOPTS += -g -O2 -Wall #flags for valgrind
INCLS := -I$(USR)/include
#LD := $(BIN)/arm-eabi-gcc
LD = $(BIN)/arm-linux-androideabi-gcc
LDOPTS := -g -O2 -Wall #flags for valgrind
LDOPTS += -Wl,--entry=main,-rpath-link=$(USR)/lib,--dynamic-linker=/system/bin/linker -nostartfiles -nostdlib
#LDOPTS += -Wl,--entry=main,-rpath-link=$(USR)/lib,-rpath=/data/local/fins,--dynamic-linker=/system/bin/linker -nostartfiles -nostdlib
#LDOPTS += $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
#LDOPTS += $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/libgcov.a
LIBPATHS := -L$(USR)/lib
#LIBPATHS += -L$(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3
#LIBPATHS += -L$(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.6
LIBS := -lc -lgcc -llog -lm
endif
GDB_CLIENT := $(BIN)/arm-eabi-gdb
INSTALL_DIR := /data/local/fins
#INSTALL_DIR := /sdcard/fins #can't run there
endif
###### build for android x86 ######
ifdef BUILD_FOR_ANDROID_X86
TARGET_PLATFORM := "Android arch-x86"
FOLDER_LIST := trunk examples tests
EXECS_LIST := common libs capturer core
CC := /home/bucknell/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/i686-android-linux-gcc --sysroot=/home/bucknell/android-ndk-r6/platforms/android-9/arch-x86
CCOPTS := -DBUILD_FOR_ANDROID #-nostdinc
INCLS := -I/home/bucknell/android-x86/external/libpcap -I/home/bucknell/android-x86/external/libconfig-1.4.7/lib -I/home/bucknell/android-x86/external/libpcap/pcap -I/home/bucknell/android-x86/bionic/libc/include -I/home/bucknell/android-x86/bionic/libc/arch-x86/include -I/home/bucknell/android-x86/bionic/libc/kernel/common -I/home/bucknell/android-x86/bionic/libc/kernel/arch-x86
LD := $(CC)
LDOPTS := #-nostdlib
LIBPATHS := -L/home/bucknell/android-x86/out/target/product/generic_x86/system/lib #-L/home/bucknell/android-ndk-r6/platforms/android-9/arch-x86/usr/lib
LIBS := -lconfig -lpcap -lm -ldl -lc
endif
###### build for linux ######
ifdef BUILD_FOR_LINUX
TARGET_PLATFORM := "Linux x86"
ARCH := x86
FOLDER_LIST := trunk examples tests
EXECS_LIST := capturer console core wedge
#signals using a different system & not to set the values of CC, LD, CFLAGS, LDFLAGS
ifndef ALTERNATIVE_BUILD
CC = gcc
CCOPTS := -g -O0 -Wall #flags for valgrind
#CCOPTS := -Wall
INCLS :=
LD = gcc
LDOPTS := -g -O0 -Wall #flags for valgrind
#LDOPTS := -Wall
LIBPATHS :=
LIBS :=
endif
GDB_CLIENT := gdb
INSTALL_DIR := /lib/modules/$(shell uname -r)/kernel/fins
endif
###### Deferred Common stuff ######
CFLAGS = $(strip $(CCOPTS) $(INCLS))
LDFLAGS = $(strip $(LDOPTS) $(LIBPATHS) $(LIBS))
Jump to Line
Something went wrong with that request. Please try again.