2 # Applied Research Associates Inc. (c)2011
\r
4 # Redistribution and use in source and binary forms,
\r
5 # with or without modification, are permitted provided that the
\r
6 # following conditions are met:
\r
7 # * Redistributions of source code must retain the above copyright
\r
8 # notice, this list of conditions and the following disclaimer.
\r
9 # * Redistributions in binary form must reproduce the above copyright
\r
10 # notice, this list of conditions and the following disclaimer in the
\r
11 # documentation and/or other materials provided with the distribution.
\r
12 # * Neither the name of the Applied Research Associates Inc nor the names
\r
13 # of its contributors may be used to endorse or promote products derived
\r
14 # from this software without specific prior written permission.
\r
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
\r
17 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
18 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
\r
19 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
\r
20 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
\r
21 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
\r
22 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
\r
23 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
\r
24 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
\r
25 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
\r
26 # POSSIBILITY OF SUCH DAMAGE.
\r
29 # NOTE: The local path here is defined based on an environment
\r
30 # variable that points to the root of the Bullet/PhysicsEffects
\r
31 # code base. The variable must be set in the Cygwin style, e.g.,
\r
32 # BULLET_PFX_ROOT_CYGWIN = /cygdrive/d/tools/PhysicsEffectsRootPath
\r
34 # The reason for *not* just setting local path := $(call my-dir)
\r
35 # is that we wish to access local source files that are *not*
\r
36 # located in a "jni" subfolder and *not* located in a subfolder
\r
37 # of the project folder. This enables us to have Eclipse and
\r
38 # Android NDK projects that fit neatly into the Bullet/PhysicsEffects
\r
39 # folder structure, enabling a multi platform code base, without
\r
40 # forcing the "jni" and subfolder structure that Android SDK/NDK
\r
41 # prefer for pure Android projects.
\r
42 LOCAL_PATH:= $(BULLET_PFX_ROOT_CYGWIN)
\r
44 # Copy the shared static library, libpfxlibrary.a, into the build
\r
45 include $(CLEAR_VARS)
\r
46 LOCAL_MODULE := pfxlibrary
\r
47 LOCAL_SRC_FILES := project/Android/PfxLibrary/obj/local/armeabi-v7a/libpfxlibrary.a
\r
48 include $(PREBUILT_STATIC_LIBRARY)
\r
50 include $(CLEAR_VARS)
\r
51 # Warning: do not enable SIMD vector math functions or NEON for running
\r
52 # in the Android NDK emulator. NEON requires a physical device
\r
53 # with NEON support.
\r
55 # Note that in theory we can let LOCAL_ARM_NEON := true determine
\r
56 # that the flags -mfpu=neon and -mfloat-abi=softfp should be applied.
\r
57 # However, in practice we have seen one case where the ndk-build
\r
58 # script "forgets" these flags for the occasional *.cpp file, thus
\r
59 # causing those files to access the std definition of vectormath
\r
60 # classes, which are completely different, including different size.
\r
61 # So, we explicitly apply these flags to avoid having a broken
\r
64 # Include -DSCE_PFX_USE_SIMD_VECTORMATH to build for ARM NEON SIMD
\r
65 # intrinsics, and leave it off to use NEON for scalar math but without
\r
68 LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -mfpu=neon -mfloat-abi=softfp -DSCE_PFX_USE_SIMD_VECTORMATH
\r
70 # apply these flags if needed
\r
71 # -ffast-math -funsafe-math-optimizations
\r
73 # apply this to disable optimization
\r
74 # TARGET_CFLAGS := $(TARGET_CFLAGS) -O0
\r
76 # apply these 2 to turn on assembly output (*.c/*.cpp to *.s file)
\r
77 # compile-cpp-source = $(eval $(call ev-compile-cpp-source,$1,$(1:%$(LOCAL_CPP_EXTENSION)=%.s)))
\r
78 # TARGET_CFLAGS := $(TARGET_CFLAGS) -S
\r
80 # specify static libraries to link in
\r
81 LOCAL_STATIC_LIBRARIES := pfxlibrary
\r
83 # Enable or disable NEON. Don't forget to apply, or not apply, -mfpu=neon and -mfloat-abi=softfp
\r
84 # flags in addition, e.g., if this is true both of those need to be included in LOCAL_CFLAGS
\r
85 # to avoid the possibility that ndk-build will "forget" to add them on some files
\r
86 LOCAL_ARM_NEON := true
\r
87 TARGET_CFLAGS := $(filter-out -ffpu=vfp,$(TARGET_CFLAGS))
\r
89 LOCAL_MODULE := PfxApp_5_Raycast
\r
90 LOCAL_C_INCLUDES := \
\r
91 $(LOCAL_PATH)/include \
\r
92 $(LOCAL_PATH)sample/api_physics_effects/5_raycast \
\r
93 $(LOCAL_PATH)sample/api_physics_effects/common
\r
95 LOCAL_SRC_FILES := \
\r
96 sample/api_physics_effects/common/jni/physicseffects-android.cpp \
\r
97 sample/api_physics_effects/5_raycast/main.cpp \
\r
98 sample/api_physics_effects/5_raycast/physics_func.cpp \
\r
99 sample/api_physics_effects/common/ctrl_func.android.cpp \
\r
100 sample/api_physics_effects/common/render_func.android.cpp \
\r
101 sample/api_physics_effects/common/perf_func.android.cpp
\r
103 LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -lGLESv1_CM -ldl -lm -llog
\r
105 include $(BUILD_SHARED_LIBRARY)
\r