Android学习第二篇;模块化编译

在学习android源码的过程中,肯定需要修改源码并查看效果

如果每次都make则太费时

此时使用mmm命令

假设修改了frameworks/base中某个文件

首先mmm frameworks/base/

再make snod

再emulator就可以看出效果了,但是这个方法只能在第一次make之后才能发挥作用,用完之后就不产生效果了。目前正在找其他办法解决

解决明明修改了代码,在mmm模块化编译时就是无法将编译的内容更新到系统上的问题

首先明确修改的代码位置

比如,修改AndroidRuntime.cpp在frameworks/base/core/jin/AndroidRuntime.cpp

进入该目录,执行

mm

退回根目录,执行

make snod

再执行emulator

可以看到效果,亲测可行

列出部分命令

  • croot - change directory to the top of the tree
  • m - execute 'make' from the top of the tree (even if your current directory is somewhere else)
  • mm - builds all of the modules in the current directory
  • mmm <dir1> ... - build all of the modules in the supplied directories
  • cgrep <pattern> - grep on all local C/C++ files
  • jgrep <pattern> - grep on all local Java files
  • resgrep <pattern> - grep on all local res/*.xml files
  • godir <filename> - go to the directory containing a file

  • make sdk - build the tools that are part of an SDK (adb, fastboot, etc.)
  • make snod - build the system image from the current software binaries
  • make services
  • make runtime
  • make droid - make droid is the normal build.
  • make all - make everything, whether it is included in the product definition or not
  • make clean - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/
  • make modules - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)
  • make <local_module> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)
  • make clean-<local_module> - clean a specific module
  • make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage - create a new boot image with custom bzImage

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章