Later when I tried to find the details on how the virtual machine was built I can't find anything in the root rakefile except for a line of comment saying "See vm.rake for more information". It was easy to locate the file but how was it loaded?
From the behaviors I could guess that rake would recursively search the up a level of directory for a rakefile if none exists in the current one, and rakefiles located in the rakelib directory would be somehow automatically imported, but I wanted some concrete documentation to prove my guess. I was astonished after some googling that it seemed that everyone knew the answers but no one ever wrote about it.
Therefore, the last weapon I could use was RTFSC. Fortunately the source code of Rake is pretty straightforward. The searching and importing logic is basically
- chdir to .. if there is no rakefile existing in the current dir;
- when finding a rakefile record its directory to location and load it;
- import all of .rake files located under location/rakelib if exist.