From 78626c480aa16a60bbae8fc46cab8bf0b7192ec2 Mon Sep 17 00:00:00 2001 From: William Roberts Date: Thu, 11 Feb 2016 10:35:07 -0800 Subject: [PATCH] fs_config: error on multiple specifications of android_filesystem_config.h Multiple files added to TARGET_ANDROID_FILESYSTEM_CONFIG_H will build, however the tooling will only respect the first header found. The sanity check in the makefile will only check the first path found for proper naming convention. One can end up with a successful build that does not respect all files in the TARGET_ANDROID_FILESYSTEM_CONFIG_H. Check that one and only one item is set to TARGET_ANDROID_FILESYSTEM_CONFIG_H variable. Output: *** Multiple fs_config files specified, see "device/lge/bullhead/two/android_filesystem_config.h device/lge/bullhead/one/android_filesystem_config.h".. Change-Id: I70a43f44713b273cb9a78f54ff16854b9e11af4a Signed-off-by: William Roberts --- tools/fs_config/Android.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/fs_config/Android.mk b/tools/fs_config/Android.mk index 34a35220f..be140b500 100644 --- a/tools/fs_config/Android.mk +++ b/tools/fs_config/Android.mk @@ -37,6 +37,13 @@ include $(BUILD_HOST_EXECUTABLE) ANDROID_FS_CONFIG_H := android_filesystem_config.h ifneq ($(TARGET_ANDROID_FILESYSTEM_CONFIG_H),) + +# One and only one file can be specified. +ifneq ($(words $(TARGET_ANDROID_FILESYSTEM_CONFIG_H)),1) +$(error Multiple fs_config files specified, \ + see "$(TARGET_ANDROID_FILESYSTEM_CONFIG_H)".) +endif + ifeq ($(filter %/$(ANDROID_FS_CONFIG_H),$(TARGET_ANDROID_FILESYSTEM_CONFIG_H)),) $(error TARGET_ANDROID_FILESYSTEM_CONFIG_H file name must be $(ANDROID_FS_CONFIG_H), \ see "$(notdir $(TARGET_ANDROID_FILESYSTEM_CONFIG_H))".)