Is there a configuration file for gnu make?

前端 未结 5 988
误落风尘
误落风尘 2021-01-17 11:37

I want to tell make that it shall always use -j4 option even if I didn\'t specify it vie command line. Normally i would do this in some configuration file (i.e.

5条回答
  •  無奈伤痛
    2021-01-17 12:16

    Have a read about the $(MAKEFLAGS) variable:

    export MAKEFLAGS=j4
    

    However this will likely interfere with recursive-make-based builds (not that sensible people are using recursive make anyway!), by interfering with GNU make's ability to communicate with its sub-makes.

    So the more sensible approach is probably a wrapper script or an alias or shell function.

提交回复
热议问题