Android.mk - set a src path (folder) instead of paths to src files and other related stuff

138 views
Skip to first unread message

Aristarh Smertin

unread,
Jan 25, 2012, 12:57:19 PM1/25/12
to andro...@googlegroups.com
If we can set LOCAL_C_INCLUDES := $(LOCAL_PATH)/lib/inc (.h files)
Can't we set LOCAL_SRC_FILES := $(LOCAL_PATH)/lib/src (.c/cpp)? (well this won't work)
Is there anyway to tell what whole folder content src files instread of
LOCAL_MODULE := lib
LOCAL_SRC_FILES := \
lib/src/lib.cpp \
lib/src/liba.cpp \
lib/src/libc.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/lib/inc

I think i missed something but shared libs compile in alphabet way?
liba, libb, libc?
so if libb depends of libc (libb -lc)  it wont build cos libc will compile last even if we put it first in Android.mk

Is it possible to use only static libs? Can someone give example?

Thomas Martitz

unread,
Jan 26, 2012, 2:51:50 AM1/26/12
to andro...@googlegroups.com
Am 25.01.2012 18:57, schrieb Aristarh Smertin:
> LOCAL_MODULE := lib
> LOCAL_SRC_FILES := \
> lib/src/lib.cpp \
> lib/src/liba.cpp \
> lib/src/libc.cpp
> LOCAL_C_INCLUDES := $(LOCAL_PATH)/lib/inc


Try LOCAL_SRC_FILES := $(wildcard lib/src/lib*.cpp)

wildcard is make built-in, see
http://theory.uwinnipeg.ca/localfiles/infofiles/make/make_25.html. There
are other built-ins as well.

Aristarh Smertin

unread,
Jan 26, 2012, 3:26:11 AM1/26/12
to android-ndk
You made my day

On 26 янв, 11:51, Thomas Martitz <thomas.mart...@student.htw-
berlin.de> wrote:
> Am 25.01.2012 18:57, schrieb Aristarh Smertin:
>
> > LOCAL_MODULE := lib
> > LOCAL_SRC_FILES := \
> > lib/src/lib.cpp \
> > lib/src/liba.cpp \
> > lib/src/libc.cpp
> > LOCAL_C_INCLUDES := $(LOCAL_PATH)/lib/inc
>
> Try LOCAL_SRC_FILES := $(wildcard lib/src/lib*.cpp)
>
> wildcard is make built-in, seehttp://theory.uwinnipeg.ca/localfiles/infofiles/make/make_25.html. There
Reply all
Reply to author
Forward
0 new messages