android.mk multiple sources files

3,889 views
Skip to first unread message

Gabriel Huie

unread,
Sep 20, 2010, 2:38:34 PM9/20/10
to android-ndk
Hi i was just wondering is there a way to include mutlitple
local_source_files or should i just write them all in one at a time. I
was trying to figure out if there was a way to do *.cpp somwhere but
it just says i cant find a *.cpp file so trying to avoid typing more
then fifty source files

David Turner

unread,
Sep 20, 2010, 2:48:29 PM9/20/10
to andro...@googlegroups.com
What only matters is the definition of LOCAL_SRC_FILES when you include $(BUILD_SHARED_LIBRARY).
You can perfectly define it in several chunks using := for the first set of sources, then += for others.

For example:

LOCAL_SRC_FILES := foo.c bar.cpp

... some other stuff

LOCAL_SRC_FILES += zoo.cpp

NOTE: All source files listed in LOCAL_SRC_FILES are relative to $(LOCAL_PATH), so you can do stuff like:

LOCAL_SRC_FILES := foo/foo1.c foo/foo2.c
LOCAL_SRC_FILES += bar/bar1.c zoo/zoo1.c

Hope this helps


--
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.


Gabriel Huie

unread,
Sep 20, 2010, 2:57:27 PM9/20/10
to android-ndk
This helps but im also trying to find a way to echo i guess all the
files like so i dont have to type out all the files like foo.cpp
bar.cpp zoo.cpp is there a way to just do *.cpp and get them all at
first i tried
$(shell echo *.cpp) to get a list of them but i tididnt work when i
included it
LOCAL_SRC_FILES := $(shell echo *.cpp)
> > android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
> > .
Reply all
Reply to author
Forward
Message has been deleted
0 new messages