Make “make” default to “make -j 8”

前端 未结 8 1077
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-28 20:00

Is there a way that I can make

$ make

default to:

$ make -j 8

?

8条回答
  •  [愿得一人]
    2020-12-28 20:19

    Why not create an outer makefile, that calls another makefile like this, this is replicated from the manual here.

         SUBDIRS = foo bar baz
         .PHONY: subdirs $(SUBDIRS)
         subdirs: $(SUBDIRS)
         $(SUBDIRS):
                 $(MAKE) -j 8 -C $@
    
         foo: baz
    

提交回复
热议问题