building native libraries outside ndk

9 views
Skip to first unread message

guich

unread,
Dec 21, 2009, 3:30:55 PM12/21/09
to android-ndk
Hi,

I'm just starting to create my native lib, so, please excuse me if i'm
asking a too dumb question.

I have this directory scheme:

/TotalCrossSDK/src (java files)
/TotalCrossVM/src (native C files)

From what i read, it is not possible to build a native library outside
the NDK. Actually, i placed my Android project inside a TotalCrossVM/
builders folder, but when i run "make APP=tcvm", i get that the
makefile was not found.

Can i run the make with a project outside the NDK folder? Or do i have
really to put my project under the NDK?

Merry Christmas.

guich

allstars

unread,
Dec 21, 2009, 9:39:17 PM12/21/09
to android-ndk
sure you can
but first you need to create a folder inside $NDK/apps/your_proj
in the your_proc folder create an Application.apk
specify the
APP_PROJECT_PATH to the absolute path

guich

unread,
Dec 22, 2009, 4:20:41 AM12/22/09
to android-ndk
Hi,

> but first you need to create a folder inside $NDK/apps/your_proj
> in the your_proc folder create an Application.apk
> specify the
> APP_PROJECT_PATH to the absolute path

So, the creation of a "project stub" in $NDK/apps/your_proj is really
mandatory? Couldn't i call "make APP=xxx ndk_folder=yyyy" so i could
run make from inside the absolute path?

I'm asking this because we work in a team with CVS and i really don't
want to add NDK to the CVS.

thanks

David Turner

unread,
Dec 22, 2009, 12:21:20 PM12/22/09
to andro...@googlegroups.com
Just create a symlink from $NDK/apps/<name>/Application.mk to your $PROJECT/Application.mk


--

You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.



guich

unread,
Dec 22, 2009, 12:39:28 PM12/22/09
to android-ndk
> Just create a symlink from $NDK/apps/<name>/Application.mk to your
> $PROJECT/Application.mk

Thanks, but symlink is only available in ntfs on windows, and i use
fat32. I really hope that this can be better supported in the future,
maybe passing a parameter to make.

thanks

guich

David Turner

unread,
Dec 22, 2009, 4:48:00 PM12/22/09
to andro...@googlegroups.com
This will be supported in the future, but I can't give specifics or an ETA right now.

allstars

unread,
Dec 22, 2009, 10:18:11 PM12/22/09
to android-ndk
hi guich
but back to your question
adding ndk to cvs is not correct way to use cvs ,right?

also i think your suggestion should be that

YOUR_PROJ$> make -f $(NDKPATH)/GNUmakefile APP_FOLDER=/path/to/
YOUR_PROJ

because i think the way you say is to write another makefile or script
to invoke the Makefile in NDK, and not to improving current status of
NDK

thanks

Nicholas FitzRoy-Dale

unread,
Dec 26, 2009, 11:06:25 AM12/26/09
to andro...@googlegroups.com

On 22/12/2009, at 7:30 AM, guich wrote:
> Can i run the make with a project outside the NDK folder? Or do i have
> really to put my project under the NDK?

As others have pointed out, you can't. This is my workaround, as part
of my out-of-tree Makefile:

----
.PHONY: build
build: ndksetup
cd $(NDK_ROOT) && make APP=appname

.PHONY: ndksetup
ndksetup: $(NDK_ROOT)/apps/appname/Application.mk

$(NDK_ROOT)/apps/appname/Application.mk: ndk-apps/appname/Application.mk
cp -R ndk-apps/* $(NDK_ROOT)/apps/
----

Create ndk-apps/appname/Application.mk in your project directory. Then
as long as your Makefile user has installed the NDK and set NDK_ROOT
correctly, the Makefile will copy across the application stub if it
doesn't exist / whenever it changes.

Nicholas

guich

unread,
Dec 28, 2009, 9:40:31 AM12/28/09
to android-ndk
Many thanks! And have a happy 2010!
Reply all
Reply to author
Forward
0 new messages