how do i call a make file inside Android.mk

4,461 views
Skip to first unread message

Mrinal

unread,
Nov 17, 2010, 9:48:00 AM11/17/10
to android-porting
I am working on GTV which is basically android.

the Android.mk file gets picked from the build system that does the
needful.

My problem:
I have a application player which is running as a service and another
application discplayer which connects to it and plays the movie.

the player is built differently and it is copied to the appropriate
system/bin folder. It is huge and we intend to only use it as a
external library

android/vendor/videon/player/tools/gtv-discplayer is the structure of
my directory.

now i have the following Android.mk file in the player directory
=============================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile

.PHONY: libvideonplayer
libvideonplayer:
cd $(LOCAL_PATH)/../../../videon/player && $(MAKE) dib-config install-
bdj all

LOCAL_MODULE := libvideonplayer
include $(call all-subdir-makefiles)
============================

and the following Android.mk is present in the player/tools/gtv-
discplayer
=============================

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

############################################################
LOCAL_STATIC_JAVA_LIBRARIES := videon-lib
LOCAL_MODULE_TAGS := eng user
############################################################

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_REQUIRED_MODULES := libvideonplayer

LOCAL_PACKAGE_NAME := Videon

include $(BUILD_PACKAGE)

############################################################
include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
videon-lib:libs/disc_player_service.jar

include $(BUILD_MULTI_PREBUILT)
====================================

now if I do a 'make libvideonplayer' everything goes fine

but if i do a simple make from the topmost android directory the
dicsplayer app gets built but the player does not. Somehow the
libvideonplayer is not being picked up.
I realize that 'ALL_MODULES' is responsible for getting the
LOCAL_MODULES.

Am I missing something here?

Deva R

unread,
Nov 17, 2010, 1:06:35 PM11/17/10
to mri...@videon-central.com, android-porting
Hi
If Android.mk is not picked form top file, you can add an Android.mk containing below include command at android/vendor/videon/ level.
include $(call first-makefiles-under,$(call my-dir))

-- 
Regards,
Deva

Mrinal

unread,
Nov 17, 2010, 1:13:44 PM11/17/10
to android-porting
Thanks Deva,

I think i misdiagnosed the issue
I think the vendor/videon/player/Android.mk file is being picked up.

The question how would i call libvideonplayer target from the top
directory with just calling make?

On Nov 17, 1:06 pm, Deva R <r.deva...@gmail.com> wrote:
> Hi
> If Android.mk is not picked form top file, you can add an Android.mk
> containing below include command at android/vendor/videon/ level.
> include $(call first-makefiles-under,$(call my-dir))
> Sample file:http://git.omapzoom.org/?p=platform/hardware/ti/omap3.git;a=blob;f=An...
>
> <http://git.omapzoom.org/?p=platform/hardware/ti/omap3.git;a=blob;f=An...>
> --
> Regards,
> Devawww.bittoggler.com
> > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsubscribe@ googlegroups.com>
> > website:http://groups.google.com/group/android-porting

Mrinal

unread,
Nov 17, 2010, 4:12:12 PM11/17/10
to android-porting
I think i got it

I have the same Android.mk file earlier in the vendor/videon/player
directory

My problem was that when i do a "make libvideonplayer" the player gets
built
but when i do a plain "make" then the libvideonplayer target is not
picked up

According to android/build/core/build-system.html (I think this file
is only available with GTV distro)

--A plain "make" is the same as "make eng". droid is an alias for
eng.--

so instead for running just "make" i could be having "make droid
libvideonplayer" which serves my purpose.

Although i think this is a workaround. I think android should have a
list of target before and after the main installation.
This way we could pump our custom targets.



On Nov 17, 1:06 pm, Deva R <r.deva...@gmail.com> wrote:
> Hi
> If Android.mk is not picked form top file, you can add an Android.mk
> containing below include command at android/vendor/videon/ level.
> include $(call first-makefiles-under,$(call my-dir))

Ying Wang

unread,
Nov 17, 2010, 1:36:58 PM11/17/10
to mri...@videon-central.com, android-porting
On Wed, Nov 17, 2010 at 6:48 AM, Mrinal <mri...@videon-central.com> wrote:
I am working on GTV which is basically android.

the Android.mk file gets picked from the build system that does the
needful.

My problem:
I have a application player which is running as a service and another
application discplayer which connects to it and plays the movie.

the player is built differently and it is copied to the appropriate
system/bin folder. It is huge and we intend to only use it as a
external library

android/vendor/videon/player/tools/gtv-discplayer is the structure of
my directory.

now i have the following Android.mk file in the player directory
=============================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile

.PHONY: libvideonplayer
libvideonplayer:
       cd $(LOCAL_PATH)/../../../videon/player &&      $(MAKE) dib-config install-
bdj all

LOCAL_MODULE := libvideonplayer
You can not do this. 
You have to include some build template, such as $(BUILD_EXECUTABLE), to define a module that uses your LOCAL_MODULE.
You have 2 choices here:
#1 Adapt the original Makefile to an Android.mk, in which you define you own module by including $(BUILD_EXECUTABLE).
#2 Build the executable as a prebuilt executable: that's to say, don't integrate its Makefile into the android build system. Then copy the prebuilt binary (suppose it's called videonplayer) into the source tree and define a prebuilt module:

############################################################
include $(CLEAR_VARS)

LOCAL_PREBUILT_EXECUTABLES := videonplayer
LOCAL_MODULE_TAGS := optional
include $(BUILD_MULTI_PREBUILT)

 
Reply all
Reply to author
Forward
0 new messages