3 ms·
If anyone wants to do non-recursive make for big projects, I would take a look at what the Android platform does. They have this elaborate Android.mk makefile
by chubot 12y ago
If anyone wants to do non-recursive make for big projects, I would take a look at what the Android platform does. They have this elaborate Android.mk makefile fragment system.
At the beginning of the build you go and find all the fragments, then process/concatenate them into one huge makefile, and do a single make invocation. It results in a very parallelizable build.
It seems kinda crazy and hacky but it definitely works better than recursive make.
For some reason the best docs seem to be on this Korean site:
http://www.kandroid.org/ndk/docs/ANDROID-MK.html http://www.kandroid.org/ndk/docs/ANDROID-MK.html
- maxhou 12y agoExcept parsing all the Android.mk and computing the dependencies is slow as hell. Try running make at the top of an AOSP tree, it takes about 60 seconds, and that part cannot be parallelized. If you are looking for alternatives, have a look at http://martine.github.io/ninja/ http://martine.github.io/ninja/
- chubot 12y agoYeah definitely if you were starting from scratch, I would consider other build systems. But if you already have a huge mess of recursive make, it might be easier to port it to a non-recursive Android-like system then completely rewrite it with gyp/gn/cmake + ninja. It would speed up your full build times; not sure what it would do to incremental build times. It is true that the Android.mk thing has a large startup cost. Then again, you're building a whole OS with one make invocation, which is kinda cool.