summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2016-05-12 12:42:09 -0700
committerDominic Rizzo <domrizzo@google.com>2016-05-13 16:44:15 +0000
commit4bc7964f5bb974fdea4e992f99ade5ecee3d4068 (patch)
treefeefc3ac3e69f8e93120c04144548b3752bb8f9a /Makefile
parent849ccf7c91ef22c818896bb16c7fbc22c09cc637 (diff)
downloadchrome-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--Makefile18
1 files changed, 13 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 40bf8682ed..09d960f2dd 100644
--- a/Makefile
+++ b/Makefile
@@ -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