andreasgal/B2G — pull request #146 by ThinkerYzu (2012-01-28 09:30:25+00:00)
Title: Use flag files to hack dependencies

The flag files, here, mean files as timestamps to track changes and updates of a set of files or modules. This branch uses flag files as placeholders of files and modules to define makefile rules. For example, we use .gecko-chg as the flag file for all source files of gecko. The flag file will be touched for changes of source files. We use .gecko-build-done as the flag file for all binary files or data files generated from gecko source files. .gecko-build-done depends on .gecko-chg. Once .gecko-chg have been touched for changes of source files, rules for .gecko-build-done are triggered.

MAKE_CHANGE_FLAG is a macro defined in Makefile of B2G for this branch. It provides a framework to define flag files. For any flag "foo", it defines two flag files, ".foo-chg" and ".foo-build-done". Once you define flag "foo" in Makefile, it checks source files of given modules and update ".foo-chg" for necessary before doing any task (any target). For more information of MAKE_CHANGE_FLAG, check definitions and use cases in Makefile.

This branch also makes gecko and gaia as a part of building process of gonk. glue/gonk/vendor/mozilla/gonk/Android.mk defines modules for gecko and gaia. They call back to *-gonk-install targets in /Makefile of B2G. It avoids to call building system of gonk for multiple times, and save time. Once any source file of gonk, gecko and gaia is changed, relative modules are rebuilt automatically. For example, it takes 15s for changes of gaia to build system image. It takes 1.5s to check soruce files for my desktop if nothing have been changed.