BaseTools: Update BaseTools top GNUMakefile with the clear dependency

https://bugzilla.tianocore.org/show_bug.cgi?id=786

After GNUmakefile dependency is fixed up, it can make with -j N to enable
multiple thread build in base tools C source and save build time.

In my linux host machine, make -j 4 to compile BaseTools and save ~60% time.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Liming Gao 2017-11-28 11:18:51 +08:00
parent a9f6e0a4dc
commit 9e1131b70b
2 changed files with 12 additions and 7 deletions

View File

@ -1,7 +1,7 @@
## @file ## @file
# GNU/Linux makefile for Base Tools project build. # GNU/Linux makefile for Base Tools project build.
# #
# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at # which accompanies this distribution. The full text of the license may be found at
@ -24,12 +24,10 @@ subdirs: $(SUBDIRS)
$(SUBDIRS): $(SUBDIRS):
$(MAKE) -C $@ $(MAKE) -C $@
Tests: $(SOURCE_SUBDIRS)
.PHONY: $(CLEAN_SUBDIRS) .PHONY: $(CLEAN_SUBDIRS)
$(CLEAN_SUBDIRS): $(CLEAN_SUBDIRS):
-$(MAKE) -C $(@:-clean=) clean -$(MAKE) -C $(@:-clean=) clean
clean: $(CLEAN_SUBDIRS) clean: $(CLEAN_SUBDIRS)
test:
@$(MAKE) -C Tests

View File

@ -1,7 +1,7 @@
## @file ## @file
# GNU/Linux makefile for C tools build. # GNU/Linux makefile for C tools build.
# #
# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -44,10 +44,11 @@ MAKEROOT = .
include Makefiles/header.makefile include Makefiles/header.makefile
all: makerootdir subdirs $(MAKEROOT)/libs all: makerootdir subdirs
@echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH) @echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
LIBRARIES = Common LIBRARIES = Common
VFRAUTOGEN = VfrCompile/VfrLexer.h
# NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage # NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
APPLICATIONS = \ APPLICATIONS = \
GnuGenBootSector \ GnuGenBootSector \
@ -70,6 +71,9 @@ APPLICATIONS = \
SUBDIRS := $(LIBRARIES) $(APPLICATIONS) SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
$(LIBRARIES): $(MAKEROOT)/libs
$(APPLICATIONS): $(LIBRARIES) $(MAKEROOT)/bin $(VFRAUTOGEN)
.PHONY: outputdirs .PHONY: outputdirs
makerootdir: makerootdir:
-mkdir -p $(MAKEROOT) -mkdir -p $(MAKEROOT)
@ -83,6 +87,9 @@ $(SUBDIRS):
$(patsubst %,%-clean,$(sort $(SUBDIRS))): $(patsubst %,%-clean,$(sort $(SUBDIRS))):
-$(MAKE) -C $(@:-clean=) clean -$(MAKE) -C $(@:-clean=) clean
$(VFRAUTOGEN): VfrCompile/VfrSyntax.g
$(MAKE) -C VfrCompile VfrLexer.h
clean: $(patsubst %,%-clean,$(sort $(SUBDIRS))) clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
clean: localClean clean: localClean