If I write Android.mk and device/linaro/common/common.mk like following, the pm-qa will not be build.

===device/linaro/common/common.mk===
    powertop \
+    pm-qa \
    mmtest \



====pm-qa Android.mk ====

.PHONY: pm-qa

droid: pm-qa

systemtarball: pm-qa  

#LOCAL_MODULE := pm-qa

pm-qa: \
    $(CPUFREQ) \
    $(CPUHOTPLUG) \
    $(CPUIDLE) \
    $(INCLUDE) \
    $(SCHED_MC) \
    $(SUSPEND) \
    $(THERMAL) \
    $(UTILS)
        mkdir -p ../../$(PRODUCT_OUT)/system/xbin/pm-qa/cpufreq && \
        cp $(CPUFREQ) ../../$(PRODUCT_OUT)/system/xbin/pm-qa/cpufreq


~             

On 12 June 2012 13:13, Zach Pfeffer <zach.pfeffer@linaro.org> wrote:
On 11 June 2012 21:40, Kejun Zhou <kejun.zhou@linaro.org> wrote:
> git://git.linaro.org/tools/pm-qa.git
>
> I think this makefile issue is Android team's task. I don't like to disturb
> PMWG.

First.

We don't disturb each other, we work together to build a solution
that's going to work on the platforms we need the solution to work on.
With that in mind what we have to do is create a single pm-qa
LOCAL_MODULE that's dependent on all the other modules and then
include the pm-qa hook in

device/linaro/common/common.mk

alternatively you can use the busybox method and do something like:


.PHONY: busybox

droid: busybox

systemtarball: busybox

busybox: ...stuff


that doesn't require changes to device/linaro/common/common.mk but is
fairly Linaro specific, so the previous solution is preferred. As a
follow on we don't even need a hook in  device/linaro/common/common.mk
if

LOCAL_MODULE_TAGS := test

...and we build "tests"

in fact you could just update each one of your LOCAL_MODULE_TAGS to be
tests and everything may work. To rebuild android for tests just

export TARGET_BUILD_VARIANT=tests

and then build. Bero and Zyga are working on getting all builds to make tests

>
>
> On 12 June 2012 10:37, Zach Pfeffer <zach.pfeffer@linaro.org> wrote:
>>
>> Kejun,
>>
>> Adding Hongbo and Amit.
>>
>> Which git are you working from?
>>
>> On 11 June 2012 21:07, Kejun Zhou <kejun.zhou@linaro.org> wrote:
>> >
>> >
>> > ---------- Forwarded message ----------
>> > From: Kejun Zhou <kejun.zhou@linaro.org>
>> > Date: 11 June 2012 15:57
>> > Subject: A question about Android build system.
>> > To: Mathieu Poirier <mathieu.poirier@linaro.org>, Bernhard Rosenkränzer
>> > <Bernhard.Rosenkranzer@linaro.org>
>> > Cc: Zach Pfeffer <zach.pfeffer@linaro.org>
>> >
>> >
>> > Hi,
>> > I have a question about adding pm-qa into Android. Could you give me
>> > some
>> > help?
>> > There are many scripts in pm-qa. Each script is independent test case.
>> >
>> > My question is how to make the Android build the pm-qa automatically
>> > without
>> > a modification of target/product/core.mk.
>> >
>> > Take the cpuidle which is one of pm-qa test modules.
>> > (1) There are cpuidle_01.sh, cpuidle_02.sh, cpuidle_03.sh and
>> > cpuidle_killer.c in pm-qa/cpuidle/ folder.
>> >
>> >
>> > (2) The Android.mk lists cpuidle_01.sh, cpuidle_02.sh, cpuidle_03.sh and
>> > cpuidle_killer as independent modules.
>> > ~~~~~cpuidle Android.mk~~~~~~~~~
>> > include $(call all-subdir-makefiles)
>> > LOCAL_PATH:= $(call my-dir)
>> >
>> > module_name = cpuidle
>> >
>> > define $(module_name)_add_executable
>> >     include $(CLEAR_VARS)
>> >     LOCAL_MODULE_TAGS := optional
>> >     LOCAL_MODULE_CLASS := tests
>> >     LOCAL_MODULE := $1.sh
>> >     LOCAL_SRC_FILES := $1.sh
>> >     LOCAL_MODULE_PATH :=
>> > $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
>> >     include $(BUILD_PREBUILT)
>> > endef
>> >
>> > test_num := 01 02 03
>> > $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable,
>> > $(module_name)_$(item))))
>> >
>> > include $(CLEAR_VARS)
>> > LOCAL_MODULE := cpuidle_killer
>> > LOCAL_SRC_FILES:= cpuidle_killer.c
>> > LOCAL_STATIC_LIBRARIES := libcutils libc
>> > LOCAL_MODULE_TAGS := tests
>> > LOCAL_MODULE_PATH :=
>> > $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
>> > include $(BUILD_EXECUTABLE)
>> >
>> > (3) Is it possible only add the pm-qa/cpuide folder under
>> > (Android_platform)/external/pm-qa, and the Android build system will
>> > build
>> > the pm-qa/cpuidle automatically?
>> >
>> >
>> > BRs,
>> > Kejun
>> >
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > linaro-android mailing list
>> > linaro-android@lists.linaro.org
>> > http://lists.linaro.org/mailman/listinfo/linaro-android
>> >
>>
>>
>>
>> --
>> Zach Pfeffer
>> Android Platform Team Lead, Linaro Platform Teams
>> Linaro.org | Open source software for ARM SoCs
>> Follow Linaro: http://www.facebook.com/pages/Linaro
>> http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog
>
>



--
Zach Pfeffer
Android Platform Team Lead, Linaro Platform Teams
Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog