makeを簡単にする

makeを簡単に行うには?

フルビルドすると時間がかかるので部分的に make する方法。

$ANDROID_SRC のトップディレクトリにて
$ source ./build/envsetup.sh 
とする
$ help
すると、使えるコマンドが出てくる。
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- croot:   Changes directory to the top of the tree.
- m:       Makes from the top of the tree.
- mm:      Builds all of the modules in the current directory.
- mmm:     Builds all of the modules in the supplied directories.
- cgrep:   Greps on all local C/C++ files.
- jgrep:   Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir:   Go to the directory containing a file.

Look at the source to view more functions. The complete list is:
add_lunch_combo cgrep check_product check_variant choosecombo chooseproduct choosetype choosevariant
cproj croot findmakefile gdbclient get_abs_build_var get_build_var getbugreports getprebuilt gettop 
godir help isviewserverstarted jgrep lunch m mm mmm pid print_lunch_menu printconfig resgrep runhat 
runtest set_sequence_number set_stuff_for_environment setpaths settitle smoketest startviewserver 
stopviewserver systemstack tapas tracedmdump

例1

ファイル名を指定して、カレントディレクトリを変更する。これは、結構便利ですね。
$ godir wifi.c
  [1] ./cts/tests/tests/net/src/android/net/wifi/cts
  [2] ./development/pdk/sample/partner/wifi_company/mychipset
  [3] ./external/wpa_supplicant
  [4] ./external/wpa_supplicant_6/wpa_supplicant/src/drivers
  [5] ./hardware/broadcom/wlan/bcm4329/src/shared
  [6] ./hardware/libhardware_legacy/wifi
  [7] ./packages/apps/Settings/res/layout

Select one: 6
$ pwd
(省略)hardware/libhardware_legacy/wifi

例2

カレントディレクトリのモジュールをコンパイルする。
$ cd hardware/libhardware_legacy
$ mm
この例ではソースコードに変更も何もしてないのでコンパイルやリンクは行われないが…。
あと、環境変数は export しておくのを忘れずに。
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=FRG22D
============================================
make: ディレクトリ `$ANDROID_SRC' に入ります
Copy: out/target/product/generic/system/etc/apns-conf.xml
Install: out/target/product/generic/system/lib/libhardware_legacy.so
make: ディレクトリ `$ANDROID_SRC' から出ます

他にも便利なコマンドがありますね。。。

コメント
名前:
コメント:









(2011/01/13 23:58 公開)
最終更新:2011年01月14日 19:33
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。