Is there a configuration file for gnu make?

前端 未结 5 1012
误落风尘
误落风尘 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:07

    Well, yes and no --- normally you would use an include file. Put your common configuration items together in a file, say common.mk and add

    include common.mk
    

    at the top of your makefile. If the flag doesn't have a matching way to configure it from inside the make file, you can use a function

    function mk {
        make -j4 $*
    }
    

提交回复
热议问题