The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # Copyright (C) 2008 The Android Open Source Project |
| 2 | # |
| 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 |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 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. |
| 14 | |
| 15 | LOCAL_PATH := $(call my-dir) |
Mark Salyzyn | 073a9eb | 2015-04-15 12:53:39 -0700 | [diff] [blame] | 16 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 17 | include $(CLEAR_VARS) |
| 18 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 19 | LOCAL_SRC_FILES := fs_config.c |
| 20 | LOCAL_MODULE := fs_config |
Mark Salyzyn | 073a9eb | 2015-04-15 12:53:39 -0700 | [diff] [blame] | 21 | LOCAL_SHARED_LIBRARIES := libcutils libselinux |
Mark Salyzyn | 1c5f19e | 2015-04-01 12:54:46 -0700 | [diff] [blame] | 22 | LOCAL_CFLAGS := -Werror |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 23 | |
| 24 | include $(BUILD_HOST_EXECUTABLE) |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 25 | |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 26 | # One can override the default android_filesystem_config.h file in one of two ways: |
| 27 | # |
| 28 | # 1. The old way: |
| 29 | # To Build the custom target binary for the host to generate the fs_config |
| 30 | # override files. The executable is hard coded to include the |
| 31 | # $(TARGET_ANDROID_FILESYSTEM_CONFIG_H) file if it exists. |
| 32 | # Expectations: |
| 33 | # device/<vendor>/<device>/android_filesystem_config.h |
| 34 | # fills in struct fs_path_config android_device_dirs[] and |
| 35 | # struct fs_path_config android_device_files[] |
| 36 | # device/<vendor>/<device>/device.mk |
| 37 | # PRODUCT_PACKAGES += fs_config_dirs fs_config_files |
| 38 | # If not specified, check if default one to be found |
| 39 | # |
| 40 | # 2. The new way: |
| 41 | # set TARGET_FS_CONFIG_GEN to contain a list of intermediate format files |
| 42 | # for generating the android_filesystem_config.h file. |
| 43 | # |
| 44 | # More information can be found in the README |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 45 | ANDROID_FS_CONFIG_H := android_filesystem_config.h |
| 46 | |
| 47 | ifneq ($(TARGET_ANDROID_FILESYSTEM_CONFIG_H),) |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 48 | ifneq ($(TARGET_FS_CONFIG_GEN),) |
| 49 | $(error Cannot set TARGET_ANDROID_FILESYSTEM_CONFIG_H and TARGET_FS_CONFIG_GEN simultaneously) |
| 50 | endif |
William Roberts | 78626c4 | 2016-02-11 10:35:07 -0800 | [diff] [blame] | 51 | |
| 52 | # One and only one file can be specified. |
| 53 | ifneq ($(words $(TARGET_ANDROID_FILESYSTEM_CONFIG_H)),1) |
| 54 | $(error Multiple fs_config files specified, \ |
| 55 | see "$(TARGET_ANDROID_FILESYSTEM_CONFIG_H)".) |
| 56 | endif |
| 57 | |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 58 | ifeq ($(filter %/$(ANDROID_FS_CONFIG_H),$(TARGET_ANDROID_FILESYSTEM_CONFIG_H)),) |
| 59 | $(error TARGET_ANDROID_FILESYSTEM_CONFIG_H file name must be $(ANDROID_FS_CONFIG_H), \ |
| 60 | see "$(notdir $(TARGET_ANDROID_FILESYSTEM_CONFIG_H))".) |
| 61 | endif |
| 62 | |
| 63 | my_fs_config_h := $(TARGET_ANDROID_FILESYSTEM_CONFIG_H) |
| 64 | else ifneq ($(wildcard $(TARGET_DEVICE_DIR)/$(ANDROID_FS_CONFIG_H)),) |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 65 | |
| 66 | ifneq ($(TARGET_FS_CONFIG_GEN),) |
| 67 | $(error Cannot provide $(TARGET_DEVICE_DIR)/$(ANDROID_FS_CONFIG_H) and set TARGET_FS_CONFIG_GEN simultaneously) |
| 68 | endif |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 69 | my_fs_config_h := $(TARGET_DEVICE_DIR)/$(ANDROID_FS_CONFIG_H) |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 70 | |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 71 | else |
| 72 | my_fs_config_h := $(LOCAL_PATH)/default/$(ANDROID_FS_CONFIG_H) |
| 73 | endif |
| 74 | |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 75 | ################################## |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 76 | include $(CLEAR_VARS) |
| 77 | LOCAL_SRC_FILES := fs_config_generate.c |
| 78 | LOCAL_MODULE := fs_config_generate_$(TARGET_DEVICE) |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 79 | LOCAL_MODULE_CLASS := EXECUTABLES |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 80 | LOCAL_SHARED_LIBRARIES := libcutils |
| 81 | LOCAL_CFLAGS := -Werror -Wno-error=\#warnings |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 82 | |
| 83 | ifneq ($(TARGET_FS_CONFIG_GEN),) |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 84 | system_android_filesystem_config := system/core/include/private/android_filesystem_config.h |
| 85 | |
| 86 | # Generate the "generated_oem_aid.h" file |
| 87 | oem := $(local-generated-sources-dir)/generated_oem_aid.h |
| 88 | $(oem): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) |
| 89 | $(oem): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) |
| 90 | $(oem): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) |
| 91 | $(oem): PRIVATE_CUSTOM_TOOL = $(PRIVATE_LOCAL_PATH)/fs_config_generator.py oemaid --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@ |
| 92 | $(oem): $(TARGET_FS_CONFIG_GEN) $(LOCAL_PATH)/fs_config_generator.py |
| 93 | $(transform-generated-source) |
| 94 | |
| 95 | # Generate the fs_config header |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 96 | gen := $(local-generated-sources-dir)/$(ANDROID_FS_CONFIG_H) |
| 97 | $(gen): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) |
| 98 | $(gen): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 99 | $(gen): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) |
| 100 | $(gen): PRIVATE_CUSTOM_TOOL = $(PRIVATE_LOCAL_PATH)/fs_config_generator.py fsconfig --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@ |
| 101 | $(gen): $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) $(LOCAL_PATH)/fs_config_generator.py |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 102 | $(transform-generated-source) |
| 103 | |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 104 | LOCAL_GENERATED_SOURCES := $(oem) $(gen) |
| 105 | |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 106 | my_fs_config_h := $(gen) |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 107 | my_gen_oem_aid := $(oem) |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 108 | gen := |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 109 | oem := |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 110 | endif |
| 111 | |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 112 | LOCAL_C_INCLUDES := $(dir $(my_fs_config_h)) $(dir $(my_gen_oem_aid)) |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 113 | |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 114 | include $(BUILD_HOST_EXECUTABLE) |
| 115 | fs_config_generate_bin := $(LOCAL_INSTALLED_MODULE) |
Mark Salyzyn | 1fd588c | 2017-03-22 15:53:12 -0700 | [diff] [blame] | 116 | # List of all supported vendor, oem and odm Partitions |
| 117 | fs_config_generate_extra_partition_list := $(strip \ |
| 118 | $(if $(BOARD_USES_VENDORIMAGE)$(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE),vendor) \ |
| 119 | $(if $(BOARD_USES_OEMIMAGE)$(BOARD_OEMIMAGE_FILE_SYSTEM_TYPE),oem) \ |
| 120 | $(if $(BOARD_USES_ODMIMAGE)$(BOARD_ODMIMAGE_FILE_SYSTEM_TYPE),odm)) |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 121 | |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 122 | ################################## |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 123 | # Generate the system/etc/fs_config_dirs binary file for the target |
| 124 | # Add fs_config_dirs to PRODUCT_PACKAGES in the device make file to enable |
| 125 | include $(CLEAR_VARS) |
| 126 | |
| 127 | LOCAL_MODULE := fs_config_dirs |
| 128 | LOCAL_MODULE_CLASS := ETC |
Mark Salyzyn | eb8dc72 | 2017-04-27 07:50:14 -0700 | [diff] [blame] | 129 | LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t)) |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 130 | include $(BUILD_SYSTEM)/base_rules.mk |
| 131 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 132 | @mkdir -p $(dir $@) |
Mark Salyzyn | 1fd588c | 2017-03-22 15:53:12 -0700 | [diff] [blame] | 133 | $< -D $(if $(fs_config_generate_extra_partition_list), \ |
| 134 | -P '$(subst $(space),$(comma),$(addprefix -,$(fs_config_generate_extra_partition_list)))') \ |
| 135 | -o $@ |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 136 | |
William Roberts | c950a35 | 2016-03-04 18:12:29 -0800 | [diff] [blame] | 137 | ################################## |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 138 | # Generate the system/etc/fs_config_files binary file for the target |
| 139 | # Add fs_config_files to PRODUCT_PACKAGES in the device make file to enable |
| 140 | include $(CLEAR_VARS) |
| 141 | |
| 142 | LOCAL_MODULE := fs_config_files |
| 143 | LOCAL_MODULE_CLASS := ETC |
Mark Salyzyn | eb8dc72 | 2017-04-27 07:50:14 -0700 | [diff] [blame] | 144 | LOCAL_REQUIRED_MODULES := $(foreach t,$(fs_config_generate_extra_partition_list),$(LOCAL_MODULE)_$(t)) |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 145 | include $(BUILD_SYSTEM)/base_rules.mk |
| 146 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 147 | @mkdir -p $(dir $@) |
Mark Salyzyn | 1fd588c | 2017-03-22 15:53:12 -0700 | [diff] [blame] | 148 | $< -F $(if $(fs_config_generate_extra_partition_list), \ |
| 149 | -P '$(subst $(space),$(comma),$(addprefix -,$(fs_config_generate_extra_partition_list)))') \ |
| 150 | -o $@ |
| 151 | |
| 152 | ifneq ($(filter vendor,$(fs_config_generate_extra_partition_list)),) |
| 153 | ################################## |
| 154 | # Generate the vendor/etc/fs_config_dirs binary file for the target |
| 155 | # Add fs_config_dirs or fs_config_dirs_vendor to PRODUCT_PACKAGES in |
| 156 | # the device make file to enable. |
| 157 | include $(CLEAR_VARS) |
| 158 | |
| 159 | LOCAL_MODULE := fs_config_dirs_vendor |
| 160 | LOCAL_MODULE_CLASS := ETC |
| 161 | LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs |
| 162 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc |
| 163 | include $(BUILD_SYSTEM)/base_rules.mk |
| 164 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 165 | @mkdir -p $(dir $@) |
| 166 | $< -D -P vendor -o $@ |
| 167 | |
| 168 | ################################## |
| 169 | # Generate the vendor/etc/fs_config_files binary file for the target |
| 170 | # Add fs_config_files or fs_config_files_vendor to PRODUCT_PACKAGES in |
| 171 | # the device make file to enable |
| 172 | include $(CLEAR_VARS) |
| 173 | |
| 174 | LOCAL_MODULE := fs_config_files_vendor |
| 175 | LOCAL_MODULE_CLASS := ETC |
| 176 | LOCAL_INSTALLED_MODULE_STEM := fs_config_files |
| 177 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc |
| 178 | include $(BUILD_SYSTEM)/base_rules.mk |
| 179 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 180 | @mkdir -p $(dir $@) |
| 181 | $< -F -P vendor -o $@ |
| 182 | |
| 183 | endif |
| 184 | |
| 185 | ifneq ($(filter oem,$(fs_config_generate_extra_partition_list)),) |
| 186 | ################################## |
| 187 | # Generate the oem/etc/fs_config_dirs binary file for the target |
| 188 | # Add fs_config_dirs or fs_config_dirs_oem to PRODUCT_PACKAGES in |
| 189 | # the device make file to enable |
| 190 | include $(CLEAR_VARS) |
| 191 | |
| 192 | LOCAL_MODULE := fs_config_dirs_oem |
| 193 | LOCAL_MODULE_CLASS := ETC |
| 194 | LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs |
| 195 | LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc |
| 196 | include $(BUILD_SYSTEM)/base_rules.mk |
| 197 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 198 | @mkdir -p $(dir $@) |
| 199 | $< -D -P oem -o $@ |
| 200 | |
| 201 | ################################## |
| 202 | # Generate the oem/etc/fs_config_files binary file for the target |
| 203 | # Add fs_config_files or fs_config_files_oem to PRODUCT_PACKAGES in |
| 204 | # the device make file to enable |
| 205 | include $(CLEAR_VARS) |
| 206 | |
| 207 | LOCAL_MODULE := fs_config_files_oem |
| 208 | LOCAL_MODULE_CLASS := ETC |
| 209 | LOCAL_INSTALLED_MODULE_STEM := fs_config_files |
| 210 | LOCAL_MODULE_PATH := $(TARGET_OUT_OEM)/etc |
| 211 | include $(BUILD_SYSTEM)/base_rules.mk |
| 212 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 213 | @mkdir -p $(dir $@) |
| 214 | $< -F -P oem -o $@ |
| 215 | |
| 216 | endif |
| 217 | |
| 218 | ifneq ($(filter odm,$(fs_config_generate_extra_partition_list)),) |
| 219 | ################################## |
| 220 | # Generate the odm/etc/fs_config_dirs binary file for the target |
| 221 | # Add fs_config_dirs or fs_config_dirs_odm to PRODUCT_PACKAGES in |
| 222 | # the device make file to enable |
| 223 | include $(CLEAR_VARS) |
| 224 | |
| 225 | LOCAL_MODULE := fs_config_dirs_odm |
| 226 | LOCAL_MODULE_CLASS := ETC |
| 227 | LOCAL_INSTALLED_MODULE_STEM := fs_config_dirs |
| 228 | LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc |
| 229 | include $(BUILD_SYSTEM)/base_rules.mk |
| 230 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 231 | @mkdir -p $(dir $@) |
| 232 | $< -D -P odm -o $@ |
| 233 | |
| 234 | ################################## |
| 235 | # Generate the odm/etc/fs_config_files binary file for the target |
| 236 | # Add fs_config_files of fs_config_files_odm to PRODUCT_PACKAGES in |
| 237 | # the device make file to enable |
| 238 | include $(CLEAR_VARS) |
| 239 | |
| 240 | LOCAL_MODULE := fs_config_files_odm |
| 241 | LOCAL_MODULE_CLASS := ETC |
| 242 | LOCAL_INSTALLED_MODULE_STEM := fs_config_files |
| 243 | LOCAL_MODULE_PATH := $(TARGET_OUT_ODM)/etc |
| 244 | include $(BUILD_SYSTEM)/base_rules.mk |
| 245 | $(LOCAL_BUILT_MODULE): $(fs_config_generate_bin) |
| 246 | @mkdir -p $(dir $@) |
| 247 | $< -F -P odm -o $@ |
| 248 | |
| 249 | endif |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 250 | |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 251 | # The newer passwd/group targets are only generated if you |
| 252 | # use the new TARGET_FS_CONFIG_GEN method. |
| 253 | ifneq ($(TARGET_FS_CONFIG_GEN),) |
| 254 | |
| 255 | ################################## |
| 256 | # Build the oemaid library when fs config files are present. |
| 257 | # Intentionally break build if you require generated AIDS |
| 258 | # header file, but are not using any fs config files. |
| 259 | include $(CLEAR_VARS) |
| 260 | LOCAL_MODULE := liboemaids |
| 261 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(dir $(my_gen_oem_aid)) |
| 262 | LOCAL_EXPORT_C_INCLUDE_DEPS := $(my_gen_oem_aid) |
| 263 | include $(BUILD_STATIC_LIBRARY) |
| 264 | |
| 265 | ################################## |
| 266 | # Generate the system/etc/passwd text file for the target |
| 267 | # This file may be empty if no AIDs are defined in |
| 268 | # TARGET_FS_CONFIG_GEN files. |
| 269 | include $(CLEAR_VARS) |
| 270 | |
| 271 | LOCAL_MODULE := passwd |
| 272 | LOCAL_MODULE_CLASS := ETC |
| 273 | |
| 274 | include $(BUILD_SYSTEM)/base_rules.mk |
| 275 | |
| 276 | $(LOCAL_BUILT_MODULE): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) |
| 277 | $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) |
| 278 | $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) |
| 279 | $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) |
| 280 | @mkdir -p $(dir $@) |
| 281 | $(hide) $< passwd --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@ |
| 282 | |
| 283 | ################################## |
| 284 | # Generate the system/etc/group text file for the target |
| 285 | # This file may be empty if no AIDs are defined in |
| 286 | # TARGET_FS_CONFIG_GEN files. |
| 287 | include $(CLEAR_VARS) |
| 288 | |
| 289 | LOCAL_MODULE := group |
| 290 | LOCAL_MODULE_CLASS := ETC |
| 291 | |
| 292 | include $(BUILD_SYSTEM)/base_rules.mk |
| 293 | |
| 294 | $(LOCAL_BUILT_MODULE): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) |
| 295 | $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_FS_CONFIG_GEN := $(TARGET_FS_CONFIG_GEN) |
| 296 | $(LOCAL_BUILT_MODULE): PRIVATE_ANDROID_FS_HDR := $(system_android_filesystem_config) |
| 297 | $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/fs_config_generator.py $(TARGET_FS_CONFIG_GEN) $(system_android_filesystem_config) |
| 298 | @mkdir -p $(dir $@) |
| 299 | $(hide) $< group --aid-header=$(PRIVATE_ANDROID_FS_HDR) $(PRIVATE_TARGET_FS_CONFIG_GEN) > $@ |
| 300 | |
| 301 | system_android_filesystem_config := |
| 302 | endif |
| 303 | |
Mark Salyzyn | 06b91b9 | 2015-04-01 14:41:29 -0700 | [diff] [blame] | 304 | ANDROID_FS_CONFIG_H := |
| 305 | my_fs_config_h := |
| 306 | fs_config_generate_bin := |
Elliott Hughes | 2d7c86d | 2016-12-13 23:37:07 +0000 | [diff] [blame] | 307 | my_gen_oem_aid := |
Mark Salyzyn | 5649b31 | 2017-03-22 08:46:55 -0700 | [diff] [blame] | 308 | |
| 309 | # ----------------------------------------------------------------------------- |
| 310 | # Unit tests. |
| 311 | # ----------------------------------------------------------------------------- |
| 312 | |
| 313 | test_c_flags := \ |
| 314 | -fstack-protector-all \ |
| 315 | -g \ |
| 316 | -Wall \ |
| 317 | -Wextra \ |
| 318 | -Werror \ |
| 319 | -fno-builtin \ |
| 320 | -DANDROID_FILESYSTEM_CONFIG='"android_filesystem_config_test_data.h"' |
| 321 | |
| 322 | ################################## |
| 323 | # test executable |
| 324 | include $(CLEAR_VARS) |
| 325 | LOCAL_MODULE := fs_config_generate_test |
| 326 | LOCAL_SRC_FILES := fs_config_generate.c |
| 327 | LOCAL_SHARED_LIBRARIES := libcutils |
| 328 | LOCAL_CFLAGS := $(test_c_flags) |
| 329 | LOCAL_MODULE_RELATIVE_PATH := fs_config-unit-tests |
| 330 | LOCAL_GTEST := false |
| 331 | include $(BUILD_HOST_NATIVE_TEST) |
| 332 | |
| 333 | ################################## |
| 334 | # gTest tool |
| 335 | include $(CLEAR_VARS) |
| 336 | LOCAL_MODULE := fs_config-unit-tests |
| 337 | LOCAL_CFLAGS += $(test_c_flags) -DHOST |
| 338 | LOCAL_SHARED_LIBRARIES := liblog libcutils libbase |
| 339 | LOCAL_SRC_FILES := fs_config_test.cpp |
| 340 | include $(BUILD_HOST_NATIVE_TEST) |