1 # Copyright (C) 2008 The Android Open Source Project
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 LOCAL_PATH := $(call my-dir)
19 LOCAL_SRC_FILES := fs_config.c
20 LOCAL_MODULE := fs_config
21 LOCAL_SHARED_LIBRARIES := libcutils libselinux
22 LOCAL_CFLAGS := -Werror
24 include $(BUILD_HOST_EXECUTABLE)
26 # To Build the custom target binary for the host to generate the fs_config
27 # override files. The executable is hard coded to include the
28 # $(TARGET_ANDROID_FILESYSTEM_CONFIG_H) file if it exists.
30 # device/<vendor>/<device>/android_filesystem_config.h
31 # fills in struct fs_path_config android_device_dirs[] and
32 # struct fs_path_config android_device_files[]
33 # device/<vendor>/<device>/device.mk
34 # PRODUCT_PACKAGES += fs_config_dirs fs_config_files
36 # If not specified, check if default one to be found
37 ANDROID_FS_CONFIG_H := android_filesystem_config.h
39 ifneq ($(TARGET_ANDROID_FILESYSTEM_CONFIG_H),)
40 ifeq ($(filter %/$(ANDROID_FS_CONFIG_H),$(TARGET_ANDROID_FILESYSTEM_CONFIG_H)),)
41 $(error TARGET_ANDROID_FILESYSTEM_CONFIG_H file name must be $(ANDROID_FS_CONFIG_H), \
42 see "$(notdir $(TARGET_ANDROID_FILESYSTEM_CONFIG_H))".)
45 my_fs_config_h := $(TARGET_ANDROID_FILESYSTEM_CONFIG_H)
46 else ifneq ($(wildcard $(TARGET_DEVICE_DIR)/$(ANDROID_FS_CONFIG_H)),)
47 my_fs_config_h := $(TARGET_DEVICE_DIR)/$(ANDROID_FS_CONFIG_H)
49 my_fs_config_h := $(LOCAL_PATH)/default/$(ANDROID_FS_CONFIG_H)
53 LOCAL_SRC_FILES := fs_config_generate.c
54 LOCAL_MODULE := fs_config_generate_$(TARGET_DEVICE)
55 LOCAL_SHARED_LIBRARIES := libcutils
56 LOCAL_CFLAGS := -Werror -Wno-error=\#warnings
57 LOCAL_C_INCLUDES := $(dir $(my_fs_config_h))
58 include $(BUILD_HOST_EXECUTABLE)
59 fs_config_generate_bin := $(LOCAL_INSTALLED_MODULE)
61 # Generate the system/etc/fs_config_dirs binary file for the target
62 # Add fs_config_dirs to PRODUCT_PACKAGES in the device make file to enable
65 LOCAL_MODULE := fs_config_dirs
66 LOCAL_MODULE_CLASS := ETC
67 include $(BUILD_SYSTEM)/base_rules.mk
68 $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin)
72 # Generate the system/etc/fs_config_files binary file for the target
73 # Add fs_config_files to PRODUCT_PACKAGES in the device make file to enable
76 LOCAL_MODULE := fs_config_files
77 LOCAL_MODULE_CLASS := ETC
78 include $(BUILD_SYSTEM)/base_rules.mk
79 $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin)
83 ANDROID_FS_CONFIG_H :=
85 fs_config_generate_bin :=