Discussion:
How to set up ndk-build without referencing jni folder?
gadget
2013-05-09 16:19:34 UTC
Permalink
Change .mk's to this (may need a few tweaks, writing this from memory),
then just do ndk-build on the root .mk

#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE = myJson
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm

include $(BUILD_STATIC_LIBRARY)
#=====================

#ANDROID ROOT MAKEFILE
#=====================
OLD_PATH := $(call my-dir)

# ------ other makefiles ------------- #
include $(abspath
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json)/Android.mk

# ------- main app --------------------- #
LOCAL_PATH := $OLD_PATH
include $(CLEAR_VARS)
LOCAL_MODULE := myApp
#LOCAL_SRC_FILES := ... whatever ...
LOCAL_STATIC_LIBRARIES := myJson
include $(BUILD_SHARED_LIBRARY)
#======================
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
h***@web.de
2013-05-14 11:04:16 UTC
Permalink
Thanks for your hints. Following your snipped introductions I could solve
this issue and build my
static library. But now any PREBUILD is ignored.

I've generated dynamically to my source Android.mk file:

LOCAL_PATH := $(call my-dir)

LOCAL_CFLAGS += -DDEBUG
LOCAL_CFLAGS += -DANDROID

include $(CLEAR_VARS)
LOCAL_MODULE := jsoncpp
LOCAL_SRC_FILES := ../external-deps/jsoncpp/libjsoncpp.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../jsoncpp/include
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := brCore

# this is required while prebuild is ignored.
LOCAL_C_INCLUDES = $(LOCAL_PATH)/../include

LOCAL_SRC_FILES := brConfig.cpp \
brConfigSet.cpp \
brConfigManager.cpp \
brExceptionHandler.cpp \
brFileHandler.cpp \
brFileStream.cpp \
brHalfFloat.cpp \
brLibrary.cpp \
brLog.cpp \
brNode.cpp \
brRessourceManager.cpp \
brStringUtils.cpp \
brTimer.cpp \
exceptions/brException.cpp \
stacktrace/brLinuxStackTrace.cpp \
stacktrace/brStackTrace.cpp

LOCAL_STATIC_LIBRARIES := jsoncpp
LOCAL_STATIC_LIBRARIES += android_native_app_glue

include $(BUILD_SHARED_LIBRARY)
$(call import-module, android/native_app_glue)

This make file is invoked sucessfully from my root Android.mk file. The
code compiles
successfully, but the Prebuild is not performed:

Android NDK: Using build script
D:/binrev/repository/binrevengine-mgw/modules/
brCore/trunk/Android.mk
Android NDK: Application 'local' is not debuggable
Android NDK: Selecting optimization mode through Application.mk: debug
Android NDK: Adding import directory: /d/development/android/ndk-r8e/sources
Android NDK: Building application 'local' for ABI 'armeabi-v7a'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.7' for
'armeabi-v7a
' ABI (through NDK_TOOLCHAIN_VERSION)
Android NDK: Looking for imported module with tag 'cxx-stl/gnu-libstdc++'
Android NDK: Probing
/d/development/android/ndk-r8e/sources/cxx-stl/gnu-libstd
c++/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/cxx-stl/gnu-lib
stdc++
Android NDK: Looking for imported module with tag 'android/native_app_glue'
Android NDK: Probing
/d/development/android/ndk-r8e/sources/android/native_app
_glue/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/android/native_
app_glue
Android NDK: Module 'brCore' has C++ sources
Android NDK: Add dependency 'gnustl_static' to module 'brCore'
Android NDK: Cygwin dependency file conversion script:
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then sed
-e 's
!^C:/Users/dl10hcn/AppData/Local/Temp!/tmp!ig;s!
C:/Users/dl10hcn/AppData/Local/
Temp! /tmp!ig;s!^d:/binrev/development/msys/mingw64!/mingw64!ig;s!
d:/binrev/dev
elopment/msys/mingw64! /mingw64!ig;s!^D:/binrev/development/msys!/usr!ig;s!
D:/b
inrev/development/msys! /usr!ig;s!^D:/binrev/development/msys/!/!ig;s!
D:/binrev
/development/msys/! /!ig;s!^y:!/y!ig;s! y:! /y!ig;s!^x:!/x!ig;s! x:!
/x!ig;s!^r:
!/r!ig;s! r:! /r!ig;s!^e:!/e!ig;s! e:! /e!ig;s!^d:!/d!ig;s! d:!
/d!ig;s!^c:!/c!i
g;s! c:! /c!ig;' $1.org > $1 && rm -f $1.org fi
------ end of script -----
Compile++ thumb : brCore <= brConfig.cpp
Compile++ thumb : brCore <= brConfigSet.cpp
Compile++ thumb : brCore <= brConfigManager.cpp
Compile++ thumb : brCore <= brExceptionHandler.cpp
Compile++ thumb : brCore <= brFileHandler.cpp
Compile++ thumb : brCore <= brFileStream.cpp
Compile++ thumb : brCore <= brHalfFloat.cpp
Compile++ thumb : brCore <= brLibrary.cpp
Compile++ thumb : brCore <= brLog.cpp
Compile++ thumb : brCore <= brNode.cpp
Compile++ thumb : brCore <= brRessourceManager.cpp
Compile++ thumb : brCore <= brStringUtils.cpp
Compile++ thumb : brCore <= brTimer.cpp
Compile++ thumb : brCore <= brException.cpp
Compile++ thumb : brCore <= brLinuxStackTrace.cpp
Compile++ thumb : brCore <= brStackTrace.cpp
SharedLibrary : libbrCore.so
Install : libbrCore.so =>
D:/binrev/repository/binrevengine-mgw/modules/b
rCore/trunk/libs/armeabi-v7a/libbrCore.so

[100%] Built target ndk

Any idea why my prebuild is ignored?
Actually I try to set up a CMake based NDK build for my application. I use
the CMake CONFIGURE_FILE command to create the required Android.mk,
SET(J "4" CACHE STRING "how many processes for make -j <J>")
ADD_CUSTOM_COMMAND(
OUTPUT Android-BinRev
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
COMMAND "${ANDROID_NDK}/ndk-build"
ARGS --directory=${CMAKE_BINARY_DIR}
NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
)
This works fine, but I got trouble to force the ndk-build to use a
different source folder instead of jni folder. The created object file
make.exe[3]: *** No rule to make target `jni/json_reader.cpp', needed by
`obj/lo
cal/armeabi/objs/jsoncpp/json_reader.o'. Stop.
I also tried to split the make, by using a separated Android.mk file at my
#ANDROID ROOT MAKEFILE
#=====================
LOCAL_PATH :=
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm
LOCAL_MODULE := jsoncpp
include
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json/Android.mk
include $(BUILD_STATIC_LIBRARY) # First lib, which will be built
statically.
#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
But this results in same failure. How could I solve this issue?
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
gadget
2013-05-14 15:49:09 UTC
Permalink
For this one (module: jsoncpp), you should be doing $(BUILD_STATIC_LIBRARY)
instead of $(PREBUILT_STATIC_LIBRARY), since you're building it from
source. Prebuilt is used when you already have a .a sitting in a directory
somewhere.
Post by h***@web.de
Thanks for your hints. Following your snipped introductions I could solve
this issue and build my
static library. But now any PREBUILD is ignored.
LOCAL_PATH := $(call my-dir)
LOCAL_CFLAGS += -DDEBUG
LOCAL_CFLAGS += -DANDROID
include $(CLEAR_VARS)
LOCAL_MODULE := jsoncpp
LOCAL_SRC_FILES := ../external-deps/jsoncpp/libjsoncpp.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../jsoncpp/include
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := brCore
# this is required while prebuild is ignored.
LOCAL_C_INCLUDES = $(LOCAL_PATH)/../include
LOCAL_SRC_FILES := brConfig.cpp \
brConfigSet.cpp \
brConfigManager.cpp \
brExceptionHandler.cpp \
brFileHandler.cpp \
brFileStream.cpp \
brHalfFloat.cpp \
brLibrary.cpp \
brLog.cpp \
brNode.cpp \
brRessourceManager.cpp \
brStringUtils.cpp \
brTimer.cpp \
exceptions/brException.cpp \
stacktrace/brLinuxStackTrace.cpp \
stacktrace/brStackTrace.cpp
LOCAL_STATIC_LIBRARIES := jsoncpp
LOCAL_STATIC_LIBRARIES += android_native_app_glue
include $(BUILD_SHARED_LIBRARY)
$(call import-module, android/native_app_glue)
This make file is invoked sucessfully from my root Android.mk file. The
code compiles
Android NDK: Using build script
D:/binrev/repository/binrevengine-mgw/modules/
brCore/trunk/Android.mk
Android NDK: Application 'local' is not debuggable
Android NDK: Selecting optimization mode through Application.mk: debug
/d/development/android/ndk-r8e/sources
Android NDK: Building application 'local' for ABI 'armeabi-v7a'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.7' for
'armeabi-v7a
' ABI (through NDK_TOOLCHAIN_VERSION)
Android NDK: Looking for imported module with tag 'cxx-stl/gnu-libstdc++'
Android NDK: Probing
/d/development/android/ndk-r8e/sources/cxx-stl/gnu-libstd
c++/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/cxx-stl/gnu-lib
stdc++
Android NDK: Looking for imported module with tag 'android/native_app_glue'
Android NDK: Probing
/d/development/android/ndk-r8e/sources/android/native_app
_glue/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/android/native_
app_glue
Android NDK: Module 'brCore' has C++ sources
Android NDK: Add dependency 'gnustl_static' to module 'brCore'
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then
sed -e 's
!^C:/Users/dl10hcn/AppData/Local/Temp!/tmp!ig;s!
C:/Users/dl10hcn/AppData/Local/
Temp! /tmp!ig;s!^d:/binrev/development/msys/mingw64!/mingw64!ig;s!
d:/binrev/dev
elopment/msys/mingw64!
/mingw64!ig;s!^D:/binrev/development/msys!/usr!ig;s! D:/b
inrev/development/msys! /usr!ig;s!^D:/binrev/development/msys/!/!ig;s!
D:/binrev
/development/msys/! /!ig;s!^y:!/y!ig;s! y:! /y!ig;s!^x:!/x!ig;s! x:!
!/r!ig;s! r:! /r!ig;s!^e:!/e!ig;s! e:! /e!ig;s!^d:!/d!ig;s! d:!
/d!ig;s!^c:!/c!i
g;s! c:! /c!ig;' $1.org > $1 && rm -f $1.org fi
------ end of script -----
Compile++ thumb : brCore <= brConfig.cpp
Compile++ thumb : brCore <= brConfigSet.cpp
Compile++ thumb : brCore <= brConfigManager.cpp
Compile++ thumb : brCore <= brExceptionHandler.cpp
Compile++ thumb : brCore <= brFileHandler.cpp
Compile++ thumb : brCore <= brFileStream.cpp
Compile++ thumb : brCore <= brHalfFloat.cpp
Compile++ thumb : brCore <= brLibrary.cpp
Compile++ thumb : brCore <= brLog.cpp
Compile++ thumb : brCore <= brNode.cpp
Compile++ thumb : brCore <= brRessourceManager.cpp
Compile++ thumb : brCore <= brStringUtils.cpp
Compile++ thumb : brCore <= brTimer.cpp
Compile++ thumb : brCore <= brException.cpp
Compile++ thumb : brCore <= brLinuxStackTrace.cpp
Compile++ thumb : brCore <= brStackTrace.cpp
SharedLibrary : libbrCore.so
Install : libbrCore.so =>
D:/binrev/repository/binrevengine-mgw/modules/b
rCore/trunk/libs/armeabi-v7a/libbrCore.so
[100%] Built target ndk
Any idea why my prebuild is ignored?
Actually I try to set up a CMake based NDK build for my application. I
use the CMake CONFIGURE_FILE command to create the required Android.mk,
SET(J "4" CACHE STRING "how many processes for make -j <J>")
ADD_CUSTOM_COMMAND(
OUTPUT Android-BinRev
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
COMMAND "${ANDROID_NDK}/ndk-build"
ARGS --directory=${CMAKE_BINARY_DIR}
NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
)
This works fine, but I got trouble to force the ndk-build to use a
different source folder instead of jni folder. The created object file
make.exe[3]: *** No rule to make target `jni/json_reader.cpp', needed by
`obj/lo
cal/armeabi/objs/jsoncpp/json_reader.o'. Stop.
I also tried to split the make, by using a separated Android.mk file at
#ANDROID ROOT MAKEFILE
#=====================
LOCAL_PATH :=
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm
LOCAL_MODULE := jsoncpp
include
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json/Android.mk
include $(BUILD_STATIC_LIBRARY) # First lib, which will be built
statically.
#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
But this results in same failure. How could I solve this issue?
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
h***@web.de
2013-05-14 13:08:48 UTC
Permalink
Meanwhile I tried to set up an module import, which performes the pre-build
step like the android_native_app_glue mechanism.
It works, the Android.mk file of the module import is invoked and found:

Added to Source make script:
======================
LOCAL_STATIC_LIBRARIES := jsoncpp
LOCAL_STATIC_LIBRARIES += android_native_app_glue

include $(BUILD_SHARED_LIBRARY)
$(call import-module, src/jsoncpp)
$(call import-module, android/native_app_glue)

Reslult:
======
Android NDK: Looking for imported module with tag 'src/jsoncpp'
Android NDK: Probing
/d/binrev/repository/binrevengine-mgw/modules/brCore/trun
k//src/jsoncpp/Android.mk
Android NDK: Found in
/d/binrev/repository/binrevengine-mgw/modules/brCore/t
runk//src/jsoncpp
"[INFO] JSON external-deps Makefile invoked"
Android NDK: Looking for imported module with tag 'android/native_app_glue'
Android NDK: Probing
/d/binrev/repository/binrevengine-mgw/modules/brCore/trun
k//android/native_app_glue/Android.mk
Android NDK: Probing
/d/development/android/ndk-r8e/sources/android/native_app
_glue/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/android/native_
app_glue
Android NDK: Module 'brCore' has C++ sources
Android NDK: Add dependency 'gnustl_static' to module 'brCore'
Android NDK: Cygwin dependency file conversion script:
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then sed
-e 's
!^C:/Users/dl10hcn/AppData/Local/Temp!/tmp!ig;s!
C:/Users/dl10hcn/AppData/Local/
Temp! /tmp!ig;s!^d:/binrev/development/msys/mingw64!/mingw64!ig;s!
d:/binrev/dev
elopment/msys/mingw64! /mingw64!ig;s!^D:/binrev/development/msys!/usr!ig;s!
D:/b
inrev/development/msys! /usr!ig;s!^D:/binrev/development/msys/!/!ig;s!
D:/binrev
/development/msys/! /!ig;s!^y:!/y!ig;s! y:! /y!ig;s!^x:!/x!ig;s! x:!
/x!ig;s!^r:
!/r!ig;s! r:! /r!ig;s!^e:!/e!ig;s! e:! /e!ig;s!^d:!/d!ig;s! d:!
/d!ig;s!^c:!/c!i
g;s! c:! /c!ig;' $1.org > $1 && rm -f $1.org fi
------ end of script -----
Compile++ thumb : brCore <= brConfig.cpp
Compile++ thumb : brCore <= brConfigSet.cpp
Compile++ thumb : brCore <= brConfigManager.cpp
Compile++ thumb : brCore <= brExceptionHandler.cpp
Compile++ thumb : brCore <= brFileHandler.cpp
Compile++ thumb : brCore <= brFileStream.cpp
Compile++ thumb : brCore <= brHalfFloat.cpp
Compile++ thumb : brCore <= brLibrary.cpp
Compile++ thumb : brCore <= brLog.cpp
Compile++ thumb : brCore <= brNode.cpp
Compile++ thumb : brCore <= brRessourceManager.cpp
Compile++ thumb : brCore <= brStringUtils.cpp
Compile++ thumb : brCore <= brTimer.cpp
Compile++ thumb : brCore <= brException.cpp
Compile++ thumb : brCore <= brLinuxStackTrace.cpp
Compile++ thumb : brCore <= brStackTrace.cpp
SharedLibrary : libbrCore.so
Install : libbrCore.so =>
D:/binrev/repository/binrevengine-mgw/modules/b
rCore/trunk/libs/armeabi-v7a/libbrCore.so

[100%] Built target ndk

But the* pre-build is also ignored*. When the build has been compleded. The
android_native_app_glue pre-build is performed and
the library is copied. But not for my imported jsoncpp module ...

This is strange. I'm running out of ideas ...
Actually I try to set up a CMake based NDK build for my application. I use
the CMake CONFIGURE_FILE command to create the required Android.mk,
SET(J "4" CACHE STRING "how many processes for make -j <J>")
ADD_CUSTOM_COMMAND(
OUTPUT Android-BinRev
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
COMMAND "${ANDROID_NDK}/ndk-build"
ARGS --directory=${CMAKE_BINARY_DIR}
NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
)
This works fine, but I got trouble to force the ndk-build to use a
different source folder instead of jni folder. The created object file
make.exe[3]: *** No rule to make target `jni/json_reader.cpp', needed by
`obj/lo
cal/armeabi/objs/jsoncpp/json_reader.o'. Stop.
I also tried to split the make, by using a separated Android.mk file at my
#ANDROID ROOT MAKEFILE
#=====================
LOCAL_PATH :=
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm
LOCAL_MODULE := jsoncpp
include
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json/Android.mk
include $(BUILD_STATIC_LIBRARY) # First lib, which will be built
statically.
#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
But this results in same failure. How could I solve this issue?
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
gadget
2013-05-14 15:55:55 UTC
Permalink
import-module is also a valid way (actually this is probably the preferred
way by the ndk writers) to run an external makefile. Would you minding
posting Android.mk for jsoncpp? It seems there might be a path problem -
.mk is found but the sources are not, so nothing is compiled.. maybe.
Post by h***@web.de
Meanwhile I tried to set up an module import, which performes the
pre-build step like the android_native_app_glue mechanism.
======================
LOCAL_STATIC_LIBRARIES := jsoncpp
LOCAL_STATIC_LIBRARIES += android_native_app_glue
include $(BUILD_SHARED_LIBRARY)
$(call import-module, src/jsoncpp)
$(call import-module, android/native_app_glue)
======
Android NDK: Looking for imported module with tag 'src/jsoncpp'
Android NDK: Probing
/d/binrev/repository/binrevengine-mgw/modules/brCore/trun
k//src/jsoncpp/Android.mk
Android NDK: Found in
/d/binrev/repository/binrevengine-mgw/modules/brCore/t
runk//src/jsoncpp
"[INFO] JSON external-deps Makefile invoked"
Android NDK: Looking for imported module with tag 'android/native_app_glue'
Android NDK: Probing
/d/binrev/repository/binrevengine-mgw/modules/brCore/trun
k//android/native_app_glue/Android.mk
Android NDK: Probing
/d/development/android/ndk-r8e/sources/android/native_app
_glue/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/android/native_
app_glue
Android NDK: Module 'brCore' has C++ sources
Android NDK: Add dependency 'gnustl_static' to module 'brCore'
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then
sed -e 's
!^C:/Users/dl10hcn/AppData/Local/Temp!/tmp!ig;s!
C:/Users/dl10hcn/AppData/Local/
Temp! /tmp!ig;s!^d:/binrev/development/msys/mingw64!/mingw64!ig;s!
d:/binrev/dev
elopment/msys/mingw64!
/mingw64!ig;s!^D:/binrev/development/msys!/usr!ig;s! D:/b
inrev/development/msys! /usr!ig;s!^D:/binrev/development/msys/!/!ig;s!
D:/binrev
/development/msys/! /!ig;s!^y:!/y!ig;s! y:! /y!ig;s!^x:!/x!ig;s! x:!
!/r!ig;s! r:! /r!ig;s!^e:!/e!ig;s! e:! /e!ig;s!^d:!/d!ig;s! d:!
/d!ig;s!^c:!/c!i
g;s! c:! /c!ig;' $1.org > $1 && rm -f $1.org fi
------ end of script -----
Compile++ thumb : brCore <= brConfig.cpp
Compile++ thumb : brCore <= brConfigSet.cpp
Compile++ thumb : brCore <= brConfigManager.cpp
Compile++ thumb : brCore <= brExceptionHandler.cpp
Compile++ thumb : brCore <= brFileHandler.cpp
Compile++ thumb : brCore <= brFileStream.cpp
Compile++ thumb : brCore <= brHalfFloat.cpp
Compile++ thumb : brCore <= brLibrary.cpp
Compile++ thumb : brCore <= brLog.cpp
Compile++ thumb : brCore <= brNode.cpp
Compile++ thumb : brCore <= brRessourceManager.cpp
Compile++ thumb : brCore <= brStringUtils.cpp
Compile++ thumb : brCore <= brTimer.cpp
Compile++ thumb : brCore <= brException.cpp
Compile++ thumb : brCore <= brLinuxStackTrace.cpp
Compile++ thumb : brCore <= brStackTrace.cpp
SharedLibrary : libbrCore.so
Install : libbrCore.so =>
D:/binrev/repository/binrevengine-mgw/modules/b
rCore/trunk/libs/armeabi-v7a/libbrCore.so
[100%] Built target ndk
But the* pre-build is also ignored*. When the build has been compleded.
The android_native_app_glue pre-build is performed and
the library is copied. But not for my imported jsoncpp module ...
This is strange. I'm running out of ideas ...
Actually I try to set up a CMake based NDK build for my application. I
use the CMake CONFIGURE_FILE command to create the required Android.mk,
SET(J "4" CACHE STRING "how many processes for make -j <J>")
ADD_CUSTOM_COMMAND(
OUTPUT Android-BinRev
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
COMMAND "${ANDROID_NDK}/ndk-build"
ARGS --directory=${CMAKE_BINARY_DIR}
NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
)
This works fine, but I got trouble to force the ndk-build to use a
different source folder instead of jni folder. The created object file
make.exe[3]: *** No rule to make target `jni/json_reader.cpp', needed by
`obj/lo
cal/armeabi/objs/jsoncpp/json_reader.o'. Stop.
I also tried to split the make, by using a separated Android.mk file at
#ANDROID ROOT MAKEFILE
#=====================
LOCAL_PATH :=
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm
LOCAL_MODULE := jsoncpp
include
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json/Android.mk
include $(BUILD_STATIC_LIBRARY) # First lib, which will be built
statically.
#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
But this results in same failure. How could I solve this issue?
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
h***@web.de
2013-05-14 19:06:59 UTC
Permalink
Post by gadget
For this one (module: jsoncpp), you should be doing
$(BUILD_STATIC_LIBRARY) instead of $(PREBUILT_STATIC_LIBRARY), since you're
building it from source. Prebuilt is used when you already have a .a
sitting in a directory somewhere.
The JSON module has been allready build successfully in a separated step
before I try to build my brCore module. The includes and the created static
library are located (for test) in a jsoncpp subfolder of my module.
Here is an overview of my brCore module structure (- indicates new folder):

- trunk
- include
- brCore

- src
Android.mk (source makefile)
- jsoncpp
- include
-jsoncpp
libjson.a
Android.mk (jsoncpp)

Android.mk (Root makefile)
Application.mk
AndroidManifest

This is my jsoncpp make file, based on android_native_app_glue makefile:

$(info "[INFO] JSON external-deps Makefile invoked")

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := jsoncpp
LOCAL_SRC_FILES := libjsoncpp.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
Post by gadget
Actually I try to set up a CMake based NDK build for my application. I use
the CMake CONFIGURE_FILE command to create the required Android.mk,
SET(J "4" CACHE STRING "how many processes for make -j <J>")
ADD_CUSTOM_COMMAND(
OUTPUT Android-BinRev
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
COMMAND "${ANDROID_NDK}/ndk-build"
ARGS --directory=${CMAKE_BINARY_DIR}
NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
)
This works fine, but I got trouble to force the ndk-build to use a
different source folder instead of jni folder. The created object file
make.exe[3]: *** No rule to make target `jni/json_reader.cpp', needed by
`obj/lo
cal/armeabi/objs/jsoncpp/json_reader.o'. Stop.
I also tried to split the make, by using a separated Android.mk file at my
#ANDROID ROOT MAKEFILE
#=====================
LOCAL_PATH :=
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm
LOCAL_MODULE := jsoncpp
include
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json/Android.mk
include $(BUILD_STATIC_LIBRARY) # First lib, which will be built
statically.
#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
But this results in same failure. How could I solve this issue?
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
h***@web.de
2013-05-16 06:48:47 UTC
Permalink
Meanwhile I tried all known ways to perform a prebuild, but I fail. For
better visualisation I've created a test project, where I try to perform a
prebuild using my CMake android build mechanisms and also results in this
issue. While the google groups upload is blocked by our company proxy, I've
uploaded those projects to my sourceforge project page:

https://sourceforge.net/projects/binrevengine/files/publications/

The bar project tries to perform a prebuild on foo library, which I've also
uploaded. The added tests projects could be build by your own using MinGW64
with GCC 4.7/4.8 in handshake with CMake and pre installed NDK (using r8e).
In that case you have only to perform a build using my build.sh script with
this command:

$ sh build.sh -ndk <%path to your ndk root %> -d -p (-s (only on foo, if
you to create a static library))

I also tried to force a prebuild from Android.mk root script, but this also
fails. I completly get lost and running out of ideas ...
Thanks for any help.
Post by gadget
For this one (module: jsoncpp), you should be doing
Post by gadget
$(BUILD_STATIC_LIBRARY) instead of $(PREBUILT_STATIC_LIBRARY), since you're
building it from source. Prebuilt is used when you already have a .a
sitting in a directory somewhere.
The JSON module has been allready build successfully in a separated step
before I try to build my brCore module. The includes and the created static
library are located (for test) in a jsoncpp subfolder of my module.
- trunk
- include
- brCore
- src
Android.mk (source makefile)
- jsoncpp
- include
-jsoncpp
libjson.a
Android.mk (jsoncpp)
Android.mk (Root makefile)
Application.mk
AndroidManifest
$(info "[INFO] JSON external-deps Makefile invoked")
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := jsoncpp
LOCAL_SRC_FILES := libjsoncpp.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
Post by gadget
Actually I try to set up a CMake based NDK build for my application. I
use the CMake CONFIGURE_FILE command to create the required Android.mk,
SET(J "4" CACHE STRING "how many processes for make -j <J>")
ADD_CUSTOM_COMMAND(
OUTPUT Android-BinRev
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
COMMAND "${ANDROID_NDK}/ndk-build"
ARGS --directory=${CMAKE_BINARY_DIR}
NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
)
This works fine, but I got trouble to force the ndk-build to use a
different source folder instead of jni folder. The created object file
make.exe[3]: *** No rule to make target `jni/json_reader.cpp', needed by
`obj/lo
cal/armeabi/objs/jsoncpp/json_reader.o'. Stop.
I also tried to split the make, by using a separated Android.mk file at
#ANDROID ROOT MAKEFILE
#=====================
LOCAL_PATH :=
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm
LOCAL_MODULE := jsoncpp
include
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json/Android.mk
include $(BUILD_STATIC_LIBRARY) # First lib, which will be built
statically.
#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
But this results in same failure. How could I solve this issue?
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...