2017-07-07 23:59:51 +02:00
|
|
|
# Command to turn collection of policy files into a policy.conf file to be
|
|
|
|
# processed by checkpolicy
|
|
|
|
define transform-policy-to-conf
|
|
|
|
@mkdir -p $(dir $@)
|
2019-06-19 19:52:50 +02:00
|
|
|
$(hide) $(M4) --fatal-warnings $(PRIVATE_ADDITIONAL_M4DEFS) \
|
2017-07-07 23:59:51 +02:00
|
|
|
-D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
|
2018-03-08 00:36:29 +01:00
|
|
|
-D target_build_variant=$(PRIVATE_TARGET_BUILD_VARIANT) \
|
2017-07-07 23:59:51 +02:00
|
|
|
-D target_with_dexpreopt=$(WITH_DEXPREOPT) \
|
|
|
|
-D target_arch=$(PRIVATE_TGT_ARCH) \
|
|
|
|
-D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \
|
2019-06-14 00:05:15 +02:00
|
|
|
-D target_with_native_coverage=$(PRIVATE_TGT_WITH_NATIVE_COVERAGE) \
|
2017-11-09 20:24:56 +01:00
|
|
|
-D target_full_treble=$(PRIVATE_SEPOLICY_SPLIT) \
|
2017-10-19 09:54:49 +02:00
|
|
|
-D target_compatible_property=$(PRIVATE_COMPATIBLE_PROPERTY) \
|
2019-09-26 08:14:55 +02:00
|
|
|
-D target_treble_sysprop_neverallow=$(PRIVATE_TREBLE_SYSPROP_NEVERALLOW) \
|
2020-09-28 06:32:43 +02:00
|
|
|
-D target_enforce_sysprop_owner=$(PRIVATE_ENFORCE_SYSPROP_OWNER) \
|
2018-06-05 23:11:08 +02:00
|
|
|
-D target_exclude_build_test=$(PRIVATE_EXCLUDE_BUILD_TEST) \
|
2019-10-16 03:10:38 +02:00
|
|
|
-D target_requires_insecure_execmem_for_swiftshader=$(PRODUCT_REQUIRES_INSECURE_EXECMEM_FOR_SWIFTSHADER) \
|
2017-07-07 23:59:51 +02:00
|
|
|
$(PRIVATE_TGT_RECOVERY) \
|
2019-06-19 19:52:50 +02:00
|
|
|
-s $(PRIVATE_POLICY_FILES) > $@
|
2017-07-07 23:59:51 +02:00
|
|
|
endef
|
|
|
|
.KATI_READONLY := transform-policy-to-conf
|
2020-09-23 12:16:10 +02:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## Collect file_contexts files into a single tmp file with m4
|
|
|
|
##
|
|
|
|
## $(1): list of file_contexts files
|
|
|
|
## $(2): filename into which file_contexts files are merged
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
define _merge-fc-files
|
|
|
|
$(2): $(1) $(M4)
|
|
|
|
$(hide) mkdir -p $$(dir $$@)
|
|
|
|
$(hide) $(M4) --fatal-warnings -s $(1) > $$@
|
|
|
|
endef
|
|
|
|
|
|
|
|
define merge-fc-files
|
|
|
|
$(eval $(call _merge-fc-files,$(1),$(2)))
|
|
|
|
endef
|