Automatically setting jobs (-j) flag for a multicore machine?

前端 未结 10 947
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 22:23

I have a Makefile on a machine that has a ton of cores in it, but I always seem to forget to write -jX when compiling my project and it takes way longer than it

10条回答
  •  执念已碎
    2020-12-12 23:09

    I would just put

    alias make='make -j'
    

    in ~/.profile or ~/.bashrc.

    According to the manual:

    If there is nothing looking like an integer after the ‘-j’ option, there is no limit on the number of job slots.

提交回复
热议问题