summaryrefslogtreecommitdiffstats
path: root/Android.mk
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-11-06 09:57:33 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2012-11-06 09:57:33 +0100
commitf3130536bc1adc6b9caa74ff1197fa4d2662d1d5 (patch)
treec50f4e3d071e21eaf7c8e4a1a6395850711b08f8 /Android.mk
parent86daaaf1a4d4cb2ee07da37687434f40f898a1f3 (diff)
Preliminary work for Android integration
Diffstat (limited to 'Android.mk')
-rw-r--r--Android.mk70
1 files changed, 70 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..cbd473d
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,70 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+testdisk_TOP := $(abspath $(LOCAL_PATH))/..
+NDK_PROJECT_PATH = $(testdisk_TOP)
+
+CONFIGURE_CC := $(TARGET_CC)
+CONFIGURE_INCLUDES := -I$(TOPMOST)/include
+CONFIGURE_LDFLAGS := -lc -ldl
+
+CONFIGURE_CFLAGS := \
+ -nostdlib -Bdynamic \
+ -Wl,-dynamic-linker,/system/bin/linker \
+ -Wl,--gc-sections \
+ -Wl,-z,nocopyreloc \
+ $(call host-path,\
+ $(TARGET_CRTBEGIN_DYNAMIC_O) \
+ $(PRIVATE_OBJECTS)) \
+ $(call link-whole-archives,$(PRIVATE_WHOLE_STATIC_LIBRARIES))\
+ $(call host-path,\
+ $(PRIVATE_STATIC_LIBRARIES) \
+ $(TARGET_LIBGCC) \
+ $(PRIVATE_SHARED_LIBRARIES)) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_LDLIBS) \
+ $(call host-path,\
+ $(TARGET_CRTEND_O)) \
+ $(CONFIGURE_INCLUDES)
+CONFIGURE_LDFLAGS += -L$(SYSROOT)/usr/lib -L$(TARGET_OUT)
+CONFIGURE_INCLUDES += -I$(SYSROOT)/usr/include
+CONFIGURE_CPP := $(TOOLCHAIN_PREFIX)cpp
+LIB := $(SYSROOT)/usr/lib
+
+CONFIGURE_CPPFLAGS := \
+ $(CONFIGURE_INCLUDES)
+
+CONFIGURE := configure
+
+TD_BUILT_MAKEFILES := $(testdisk_TOP)/src/Android.mk
+
+.PHONY: testdisk-configure testdisk-configure-real
+testdisk-configure-real:
+ echo $(TD_BUILT_MAKEFILES)
+ cd $(testdisk_TOP) ; \
+ CC="$(CONFIGURE_CC)" \
+ CFLAGS="$(CONFIGURE_CFLAGS)" \
+ LD=$(TARGET_LD) \
+ LDFLAGS="$(CONFIGURE_LDFLAGS)" \
+ CPP=$(CONFIGURE_CPP) \
+ CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
+ PKG_CONFIG_LIBDIR=$(CONFIGURE_PKG_CONFIG_LIBDIR) \
+ PKG_CONFIG_TOP_BUILD_DIR=/ \
+ $(abspath $(testdisk_TOP))/configure --host=arm-linux-androideabi \
+ --prefix=/system \
+ --libexec /system/bin \
+ --datarootdir /system/usr/share \
+ --without-ncurses --without-ext2fs --without-jpeg \
+ --without-ntfs --without-ntfs3g --without-ewf \
+ --enable-missing-uuid-ok
+ rm -f $(TD_BUILT_MAKEFILES)
+ for file in $(TD_BUILT_MAKEFILES); do \
+ echo "make -C $$(dirname $$file) $$(basename $$file)" ; \
+ make -C $$(dirname $$file) $$(basename $$file) ; \
+ done
+
+testdisk-configure: testdisk-configure-real
+
+CONFIGURE_TARGETS += testdisk-configure
+
+-include $(TD_BUILT_MAKEFILES)