Improve the build system
With stock android gone, this is easier. Big-ticket items
- All "hack" targets must die.
- Get rid of separate kernel build step by using a setup like the maguro's, in which we use a more traditional integrated source layout. The kernel build should happen as part of the gonk build.
- All targets that install or flash should have "-install/-flash" variants that track dependencies properly, and "-install-only/-flash-only" that don't. (Maybe we should use "-dirty" instead of "-only".)
- The "config-*" targets should be extremely cheap. That means, only pull libraries when they're not cached locally, and not update the mtime of config files unnecessarily (forcing rebuilds).
We can go ahead and kill support for the nexuss4g, since I'm the only person who used it AFAIK. I'll add it back if I need to use it again.
I plan to add a timestamp for every "hack" to make them as a part of dependency tracking. Building of kernel and Gecko should be triggered by gonk, a module of gonk.
https://github.com/ThinkerYzu/B2G/tree/flag-files-hack-dependencies This branch uses timestamp files (flag files) to track dependencies. It provides a way to defined dependencies, even for "hack" targets. Makefile checks hash code for all submodules and touchs 'XXX_chg' files for changes of submodules before doing anything. Once any of 'XXX_chg' files is updated, relative targets are out-of-date. For example, gecko_done is the target to build gecko. It depends on the file "gecko_chg". The file "gecko_chg" will be touched if gecko module had changed. Every target that depends on gecko has "gecko_done" in its prerequisite list. So, we can defined dependencies that base on source code of gecko, kernel and gonk.
This change introduces a 1.3s overhead with my desktop.
See also pull request #146.