Parallelization of recursive jobs in GNU make

后端 未结 4 1110
长情又很酷
长情又很酷 2021-02-02 16:08

I am looking for an elegant way for the parallelization of jobs in GNU make. Here is a sample of what I did so far. Make processes the directories dir-1, dir-2 and dir-3 in a se

4条回答
  •  独厮守ぢ
    2021-02-02 16:55

    This probably will not answer your question directly, but besides what the other answers suggest, I would recommend to look into non-recursive make techniques. That is truly an elegant way to parallelize build, although, depending on what are the existing Makefiles, can require significant effort. Non-recursive make has advantages not limited to easy parallelization: it sees a complete dependency graph and so it does not need to build too little or too much, meaning faster (sometimes much faster) build times.

    Some resources:

    • Discussion on SO
    • The classic text about trouble with recursive make
    • Design of non-recursive makefile
    • Implementation
    • Another implementation
    • Benchmarks (quite outdated though)

提交回复
热议问题