diff options
author | Bill Richardson <wfrichar@chromium.org> | 2016-05-12 12:42:09 -0700 |
---|---|---|
committer | Dominic Rizzo <domrizzo@google.com> | 2016-05-13 16:44:15 +0000 |
commit | 4bc7964f5bb974fdea4e992f99ade5ecee3d4068 (patch) | |
tree | feefc3ac3e69f8e93120c04144548b3752bb8f9a /Makefile | |
parent | 849ccf7c91ef22c818896bb16c7fbc22c09cc637 (diff) | |
download | chrome-ec-4bc7964f5bb974fdea4e992f99ade5ecee3d4068.tar.gz |
Ignore unused private board directories
If we're not building a board from a private subdirectory,
there's no need to include all the private build.mk files.
BUG=none
BRANCH=none
TEST=make buildall (with private subdirectories)
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I39b61d9b26978702717bf463b47979290cadc8dc
Reviewed-on: https://chromium-review.googlesource.com/344662
Reviewed-by: Dominic Rizzo <domrizzo@google.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -25,7 +25,7 @@ else BOARD ?= bds # Directory where the board is configured (includes /$(BOARD) at the end) -BDIR:=$(wildcard board/$(BOARD) private*/board/$(BOARD)) +BDIR:=$(wildcard board/$(BOARD) private-*/board/$(BOARD)) # There can be only one <insert exploding windows here> ifeq (,$(BDIR)) $(error unable to locate BOARD $(BOARD)) @@ -33,6 +33,9 @@ endif ifneq (1,$(words $(BDIR))) $(error multiple definitions for BOARD $(BOARD): $(BDIR)) endif +ifneq ($(filter private-%,$(BDIR)),) +PDIR=$(subst /board/$(BOARD),,$(BDIR)) +endif PROJECT?=ec @@ -119,6 +122,8 @@ $(eval CHIP_VARIANT_$(UC_CHIP_VARIANT)=y) $(eval CHIP_FAMILY_$(UC_CHIP_FAMILY)=y) # Private subdirectories may call this from their build.mk +# First arg is the path to be prepended to configured *.o files. +# Second arg is the config variable (ie, "FOO" to select with $(FOO-y)). objs_from_dir=$(foreach obj, $($(2)-y), $(1)/$(obj)) # Get build configuration from sub-directories @@ -126,12 +131,13 @@ objs_from_dir=$(foreach obj, $($(2)-y), $(1)/$(obj)) include $(BDIR)/build.mk include chip/$(CHIP)/build.mk include core/$(CORE)/build.mk - include common/build.mk include driver/build.mk include power/build.mk -include private/build.mk --include private-cr51/build.mk +ifneq ($(PDIR),) +include $(PDIR)/build.mk +endif include test/build.mk include util/build.mk include util/lock/build.mk @@ -144,13 +150,15 @@ all-obj-y+=$(call objs_from_dir,core/$(CORE),core) all-obj-y+=$(call objs_from_dir,chip/$(CHIP),chip) all-obj-y+=$(call objs_from_dir,$(BDIR),board) all-obj-y+=$(call objs_from_dir,private,private) -all-obj-y+=$(call objs_from_dir,private-cr51,private-cr51) +ifneq ($(PDIR),) +all-obj-y+=$(call objs_from_dir,$(PDIR),$(PDIR)) +endif all-obj-y+=$(call objs_from_dir,common,common) all-obj-y+=$(call objs_from_dir,driver,driver) all-obj-y+=$(call objs_from_dir,power,power) all-obj-y+=$(call objs_from_dir,test,$(PROJECT)) dirs=core/$(CORE) chip/$(CHIP) $(BDIR) common power test -dirs+= private private-cr51 +dirs+= private $(PDIR) dirs+=$(shell find driver -type d) common_dirs=util |