Thumbs.db
local.properties
build.xml
+samples/*/libs/
+samples/*/bin/
+samples/*/gen/
+build/prebuilt/
+++ /dev/null
-APP_PROJECT_PATH := $(call my-dir)/project
-APP_MODULES := libgl2jni
-
+++ /dev/null
-APP_PROJECT_PATH := $(call my-dir)/project
-APP_MODULES := hello-jni
+++ /dev/null
-APP_PROJECT_PATH := $(call my-dir)/project
-APP_MODULES := helloneon cpufeatures
-APP_ABI := armeabi armeabi-v7a
+++ /dev/null
-APP_MODULES := sanangeles
-APP_PROJECT_PATH := $(call my-dir)/project
+++ /dev/null
-APP_PROJECT_PATH := $(call my-dir)/project
-APP_MODULES := twolib-first twolib-second
+++ /dev/null
-include $(call all-subdir-makefiles)
+++ /dev/null
-APP_MODULES := \
- test-LOCAL_CFLAGS \
- test-LOCAL_CPPFLAGS
-
-APP_PROJECT_PATH := /tmp/ndk-unit-tests
-APP_BUILD_SCRIPT := $(call my-dir)/Android.mk
+++ /dev/null
-# This test is used to check that include $(CLEAR_VARS) does
-# indeed clear all variables we care for.
-
-LOCAL_PATH := $(call my-dir)
-
-# The list of LOCAL_XXX variables documented by docs/ANDROID-MK.TXT
-# Note that LOCAL_PATH is not cleared
-VARS_LOCAL := \
- MODULE \
- SRC_FILES \
- CPP_EXTENSION \
- C_INCLUDES \
- CFLAGS \
- CPPFLAGS \
- CXXFLAGS \
- STATIC_LIBRARIES \
- SHARED_LIBRARIES \
- LDLIBS \
- ALLOW_UNDEFINED_SYMBOLS \
- ARM_MODE \
-
-include $(CLEAR_VARS)
-
-$(for _var,$(VARS_LOCAL),\
- $(eval LOCAL_$(_var) := 1)\
-)
-
-include $(CLEAR_VARS)
-
-STATUS := ok
-$(foreach _var,$(VARS_LOCAL),\
- $(if $(LOCAL_$(_var)),\
- $(info variable LOCAL_$(_var) is not cleared by CLEAR_VARS)\
- $(eval STATUS := ko)\
- ,)\
-)
-
-ifeq ($(STATUS),ko)
- $(error Aborting: CLEAR_VARS does not work !)
-endif
-
-VARS_LOCAL := $(empty)
-STATUS := $(empty)
+++ /dev/null
-# Test that LOCAL_CFLAGS works for both C and C++ sources
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := test-LOCAL_CFLAGS
-LOCAL_SRC_FILES := test-LOCAL_CFLAGS-1.c \
- test-LOCAL_CFLAGS-2.cpp \
-
-LOCAL_CFLAGS := -DBANANA=100
-
-include $(BUILD_SHARED_LIBRARY)
+++ /dev/null
-#if !defined(BANANA)
-# error LOCAL_CFLAGS does not work for C source file
-#endif
-#if BANANA != 100
-# error LOCAL_CFLAGS does not work correctly for C source file
-#endif
-
-void __banana_foo1(void)
-{
-}
+++ /dev/null
-#if !defined(BANANA)
-# error LOCAL_CFLAGS does not work for C++ source file
-#endif
-#if BANANA != 100
-# error LOCAL_CFLAGS does not work correctly for C++ source file
-#endif
-
-void __banana_foo2(void)
-{
-}
+++ /dev/null
-# Test that LOCAL_CPPFLAGS only works for C++ sources
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := test-LOCAL_CPPFLAGS
-LOCAL_SRC_FILES := test-LOCAL_CPPFLAGS-1.c \
- test-LOCAL_CPPFLAGS-2.cpp \
-
-LOCAL_CFLAGS := -DBANANA=200
-
-# Note, the -UBANANA is only there to prevent a warning
-# the test works well without it.
-LOCAL_CPPFLAGS := -UBANANA -DBANANA=300
-
-include $(BUILD_SHARED_LIBRARY)
+++ /dev/null
-#if !defined(BANANA)
-# error LOCAL_CPPFLAGS does not work for C source file
-#endif
-#if BANANA != 200
-# error LOCAL_CPPFLAGS does not work correctly for C source file
-#endif
-
-void __banana_foo1(void)
-{
-}
+++ /dev/null
-#if !defined(BANANA)
-# error LOCAL_CPPFLAGS does not work for C++ source file
-#endif
-#if BANANA != 300
-# error LOCAL_CPPFLAGS does not work correctly for C++ source file
-#endif
-
-void __banana_foo2(void)
-{
-}
# flags.
TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
+# These flags are used to enfore the NX (no execute) security feature in the
+# generated machine code. This adds a special section to the generated shared
+# libraries that instruct the Linux kernel to disable code execution from
+# the stack and the heap.
+TARGET_NO_EXECUTE_CFLAGS := -Wa,--noexecstack
+TARGET_NO_EXECUTE_LDFLAGS := -Wl,-z,noexecstack
+
# The ABI-specific sub-directory that the SDK tools recognize for
# this toolchain's generated binaries
TARGET_ABI_SUBDIR := x86
fi
FLAGS=""
-if [ $VERBOSE2 = yes ] ; then
+if [ $VERBOSE = yes ] ; then
FLAGS="--verbose"
fi
NOTE: For compatibility purpose, you can still define projects
through $NDK_ROOT/apps/<name> though.
+ However, not that sample applications have moved from
+ 'apps/<name>/project' to 'samples/<name>' and now must
+ be built with 'ndk-build'. The source code of pre-existing
+ samples didn't change though.
+
- Easy native debugging support when running debuggable applications
on Android 2.2 or higher, through the new 'ndk-gdb' helper script.
See docs/NDK-GDB.TXT for details.
(The V=1 trick comes from the Linux kernel build system)
-
How to force a rebuild of all your sources:
-------------------------------------------
to point to an alternative Android.mk file.
-How to store your Application.mk in a location other than $NDK/app/<name>:
---------------------------------------------------------------------------
+How to build a project's native files without cd-ing to it:
+-----------------------------------------------------------
+
+Sometimes, you may need to rebuild a project's native file without
+being able to cd to its top-level path from the command-line. This
+is do-able by using the GNU-Make '-C <path>' option, as in:
+
+ ndk-build -C <project-path>
+
+
+How to store your Application.mk in a location other than $PROJECT/jni:
+-----------------------------------------------------------------------
Starting with NDK r4, you can simply place the file under $PROJECT/jni/
and launch the 'ndk-build' script from your project tree.
--> rebuild, using a specific Application.mk pointed to by
the NDK_APP_APPLICATION_MK command-line variable.
+ ndk-build -C <project> --> build the native code for the project
+ path located at <project>. Useful if you
+ don't want to 'cd' to it in your terminal.
+
III. Requirements:
------------------
"make APP=<name>" from the NDK directory.
This was the way this file was used before Android NDK r4.
- It is still supported for compatbility reasons, but we strongly
+ It is still supported for compatibility reasons, but we strongly
encourage you to use the first method instead, since it is much
simpler and doesn't need modifying / changing directories of the
NDK installation tree.
The NDK provides a helper script, named 'ndk-gdb' to very easily launch
a native debugging session of your applications.
-Native debugging can be performed on production devices running Android 2.2
-or higher, and does not require root or privileged access, as long as your
-application is debuggable.
+Native debugging can *ONLY* be performed on production devices running
+Android 2.2 or higher, and does not require root or privileged access, as
+long as your application is debuggable.
For more information, read docs/NDK-GDB.TXT. In a nutshell, native debugging
follows this simple scheme:
--- /dev/null
+# Build both ARMv5TE and ARMv7-A machine code.
+APP_ABI := armeabi armeabi-v7a