Use $(MAKE) when recursing

Using 'make' directly means that the jobserver environment variables don't get
passed down, so sub-builds for example don't use -j.

This is documented as the wrong thing to do:
https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html#MAKE-Variable

Use $(MAKE) instead, and compile times drastically improve:

  acrn-devicemodel    do_compile   -13.5s   -89.6%      15.0s -> 1.6s

Tracked-On: #2370
Signed-off-by: Ross Burton <ross.burton@intel.com>
This commit is contained in:
Ross Burton
2019-01-16 21:35:20 +00:00
committed by wenlingz
parent d0c9fce72d
commit 5ba4afcffe
3 changed files with 40 additions and 40 deletions

View File

@@ -165,7 +165,7 @@ all: $(DM_OBJDIR)/$(PROGRAM)
@echo -n ""
$(VMCFG_CONFIG_H):
make -C $(BASEDIR)/vmcfg $@ BASEDIR=$(BASEDIR) DM_OBJDIR=$(DM_OBJDIR)
$(MAKE) -C $(BASEDIR)/vmcfg $@ BASEDIR=$(BASEDIR) DM_OBJDIR=$(DM_OBJDIR)
$(DM_OBJDIR)/$(PROGRAM): $(OBJS)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LIBS)
@@ -228,4 +228,4 @@ install-bios: $(BIOS_BIN)
install -D --mode=0664 -t $(DESTDIR)/usr/share/acrn/bios $^
install-vmcfg:
make -C $(BASEDIR)/vmcfg install DESTDIR=$(DESTDIR) BASEDIR=$(BASEDIR)
$(MAKE) -C $(BASEDIR)/vmcfg install DESTDIR=$(DESTDIR) BASEDIR=$(BASEDIR)