Skip to content
Snippets Groups Projects
  • Nick Kralevich's avatar
    m4: add --fatal-warnings · 764cbd06
    Nick Kralevich authored
    Error out if m4 generates a warning. This will help detect and prevent
    malformed macros.
    
    See 85508496 for motivation.
    
    Test: policy compiles
    Test: Policy doesn't compile if 85508496
          is reverted.
    
    Change-Id: Iee6b6273bc2a24b1220861fd662573e76001defc
    764cbd06
definitions.mk 744 B
# 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 $@)
$(hide) m4 --fatal-warnings $(PRIVATE_ADDITIONAL_M4DEFS) \
	-D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \
	-D target_build_variant=$(PRIVATE_TARGET_BUILD_VARIANT) \
	-D target_with_dexpreopt=$(WITH_DEXPREOPT) \
	-D target_arch=$(PRIVATE_TGT_ARCH) \
	-D target_with_asan=$(PRIVATE_TGT_WITH_ASAN) \
	-D target_full_treble=$(PRIVATE_SEPOLICY_SPLIT) \
	-D target_compatible_property=$(PRIVATE_COMPATIBLE_PROPERTY) \
	-D target_exclude_build_test=$(PRIVATE_EXCLUDE_BUILD_TEST) \
	$(PRIVATE_TGT_RECOVERY) \
	-s $^ > $@
endef
.KATI_READONLY := transform-policy-to-conf