Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
William Roberts | f0e0a94 | 2012-08-27 15:41:15 -0700 | [diff] [blame] | 2 | |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 3 | include $(CLEAR_VARS) |
| 4 | |
| 5 | # SELinux policy version. |
Stephen Smalley | b4f1706 | 2015-03-13 10:03:52 -0400 | [diff] [blame] | 6 | # Must be <= /sys/fs/selinux/policyvers reported by the Android kernel. |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 7 | # Must be within the compatibility range reported by checkpolicy -V. |
Jeffrey Vander Stoep | 5ca5696 | 2015-12-08 18:15:14 +0000 | [diff] [blame] | 8 | POLICYVERS ?= 29 |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 9 | |
| 10 | MLS_SENS=1 |
| 11 | MLS_CATS=1024 |
| 12 | |
Stephen Smalley | b4f1706 | 2015-03-13 10:03:52 -0400 | [diff] [blame] | 13 | ifdef BOARD_SEPOLICY_REPLACE |
| 14 | $(error BOARD_SEPOLICY_REPLACE is no longer supported; please remove from your BoardConfig.mk or other .mk file.) |
| 15 | endif |
| 16 | |
| 17 | ifdef BOARD_SEPOLICY_IGNORE |
| 18 | $(error BOARD_SEPOLICY_IGNORE is no longer supported; please remove from your BoardConfig.mk or other .mk file.) |
| 19 | endif |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 20 | |
Stephen Smalley | 8e0ca88 | 2015-04-01 10:14:56 -0400 | [diff] [blame] | 21 | ifdef BOARD_SEPOLICY_UNION |
| 22 | $(warning BOARD_SEPOLICY_UNION is no longer required - all files found in BOARD_SEPOLICY_DIRS are implicitly unioned; please remove from your BoardConfig.mk or other .mk file.) |
| 23 | endif |
Robert Craig | 6b0ff47 | 2014-01-29 13:10:58 -0500 | [diff] [blame] | 24 | |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 25 | ifdef BOARD_SEPOLICY_M4DEFS |
| 26 | LOCAL_ADDITIONAL_M4DEFS := $(addprefix -D, $(BOARD_SEPOLICY_M4DEFS)) |
| 27 | endif |
| 28 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 29 | # Builds paths for all policy files found in BOARD_SEPOLICY_DIRS and the LOCAL_PATH. |
William Roberts | 29d1468 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 30 | # $(1): the set of policy name paths to build |
Jeffrey Vander Stoep | b1fb7e4 | 2016-01-14 23:28:51 +0000 | [diff] [blame] | 31 | build_policy = $(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(LOCAL_PATH) $(BOARD_SEPOLICY_DIRS)), $(sort $(wildcard $(file))))) |
William Roberts | 29d1468 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 32 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 33 | # Builds paths for all policy files found in BOARD_SEPOLICY_DIRS. |
| 34 | # $(1): the set of policy name paths to build |
| 35 | build_device_policy = $(foreach type, $(1), $(foreach file, $(addsuffix /$(type), $(BOARD_SEPOLICY_DIRS)), $(sort $(wildcard $(file))))) |
| 36 | |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 37 | # Add a file containing only a newline in-between each policy configuration |
| 38 | # 'contexts' file. This will allow OEM policy configuration files without a |
| 39 | # final newline (0x0A) to be built correctly by the m4(1) macro processor. |
| 40 | # $(1): the set of contexts file names. |
| 41 | # $(2): the file containing only 0x0A. |
| 42 | add_nl = $(foreach entry, $(1), $(subst $(entry), $(entry) $(2), $(entry))) |
| 43 | |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 44 | sepolicy_build_files := security_classes \ |
| 45 | initial_sids \ |
| 46 | access_vectors \ |
| 47 | global_macros \ |
Nick Kralevich | a17a266 | 2014-11-05 15:30:41 -0800 | [diff] [blame] | 48 | neverallow_macros \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 49 | mls_macros \ |
| 50 | mls \ |
| 51 | policy_capabilities \ |
| 52 | te_macros \ |
| 53 | attributes \ |
Jeff Vander Stoep | de9b530 | 2015-06-05 15:28:55 -0700 | [diff] [blame] | 54 | ioctl_macros \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 55 | *.te \ |
| 56 | roles \ |
| 57 | users \ |
| 58 | initial_sid_contexts \ |
| 59 | fs_use \ |
| 60 | genfs_contexts \ |
| 61 | port_contexts |
| 62 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 63 | ################################## |
| 64 | include $(CLEAR_VARS) |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 65 | |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 66 | LOCAL_MODULE := sectxfile_nl |
| 67 | LOCAL_MODULE_CLASS := ETC |
| 68 | LOCAL_MODULE_TAGS := optional |
| 69 | |
| 70 | # Create a file containing newline only to add between context config files |
| 71 | include $(BUILD_SYSTEM)/base_rules.mk |
William Roberts | cb1ab98 | 2015-12-14 07:54:28 -0800 | [diff] [blame] | 72 | $(LOCAL_BUILT_MODULE): |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 73 | @mkdir -p $(dir $@) |
| 74 | $(hide) echo > $@ |
| 75 | |
| 76 | built_nl := $(LOCAL_BUILT_MODULE) |
| 77 | |
| 78 | ################################# |
| 79 | include $(CLEAR_VARS) |
| 80 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 81 | LOCAL_MODULE := sepolicy |
| 82 | LOCAL_MODULE_CLASS := ETC |
| 83 | LOCAL_MODULE_TAGS := optional |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 84 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 85 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 86 | include $(BUILD_SYSTEM)/base_rules.mk |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 87 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 88 | sepolicy_policy.conf := $(intermediates)/policy.conf |
| 89 | $(sepolicy_policy.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 90 | $(sepolicy_policy.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 91 | $(sepolicy_policy.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 92 | $(sepolicy_policy.conf): $(call build_policy, $(sepolicy_build_files)) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 93 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 94 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 95 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
Nick Kralevich | 623975f | 2014-01-11 01:31:03 -0800 | [diff] [blame] | 96 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Nick Kralevich | 623975f | 2014-01-11 01:31:03 -0800 | [diff] [blame] | 97 | -s $^ > $@ |
Robert Craig | 65d4f44 | 2013-03-27 06:30:25 -0400 | [diff] [blame] | 98 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 99 | |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 100 | $(LOCAL_BUILT_MODULE): $(sepolicy_policy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy $(HOST_OUT_EXECUTABLES)/sepolicy-analyze |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 101 | @mkdir -p $(dir $@) |
Nick Kralevich | 6ef10bd | 2016-02-29 16:59:33 -0800 | [diff] [blame] | 102 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@.tmp $< > /dev/null |
| 103 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $(dir $<)/$(notdir $@).dontaudit $<.dontaudit > /dev/null |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 104 | $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains |
| 105 | $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \ |
| 106 | echo "==========" 1>&2; \ |
| 107 | echo "ERROR: permissive domains not allowed in user builds" 1>&2; \ |
| 108 | echo "List of invalid domains:" 1>&2; \ |
| 109 | cat $@.permissivedomains 1>&2; \ |
| 110 | exit 1; \ |
| 111 | fi |
| 112 | $(hide) mv $@.tmp $@ |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 113 | |
Ying Wang | d8b122c | 2012-10-25 19:01:31 -0700 | [diff] [blame] | 114 | built_sepolicy := $(LOCAL_BUILT_MODULE) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 115 | sepolicy_policy.conf := |
Stephen Smalley | 01a58af | 2012-10-02 12:46:37 -0400 | [diff] [blame] | 116 | |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 117 | ################################## |
| 118 | include $(CLEAR_VARS) |
| 119 | |
| 120 | LOCAL_MODULE := sepolicy.recovery |
| 121 | LOCAL_MODULE_CLASS := ETC |
| 122 | LOCAL_MODULE_TAGS := eng |
| 123 | |
| 124 | include $(BUILD_SYSTEM)/base_rules.mk |
| 125 | |
| 126 | sepolicy_policy_recovery.conf := $(intermediates)/policy_recovery.conf |
| 127 | $(sepolicy_policy_recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 128 | $(sepolicy_policy_recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 129 | $(sepolicy_policy_recovery.conf): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 130 | $(sepolicy_policy_recovery.conf): $(call build_policy, $(sepolicy_build_files)) |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 131 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 132 | $(hide) m4 $(PRIVATE_ADDITIONAL_M4DEFS) \ |
| 133 | -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 134 | -D target_build_variant=$(TARGET_BUILD_VARIANT) \ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 135 | -D target_recovery=true \ |
| 136 | -s $^ > $@ |
| 137 | |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 138 | $(LOCAL_BUILT_MODULE): $(sepolicy_policy_recovery.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy $(HOST_OUT_EXECUTABLES)/sepolicy-analyze |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 139 | @mkdir -p $(dir $@) |
Nick Kralevich | 6ef10bd | 2016-02-29 16:59:33 -0800 | [diff] [blame] | 140 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@.tmp $< > /dev/null |
Nick Kralevich | bca98ef | 2016-02-26 20:06:52 -0800 | [diff] [blame] | 141 | $(hide) $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $@.tmp permissive > $@.permissivedomains |
| 142 | $(hide) if [ "$(TARGET_BUILD_VARIANT)" = "user" -a -s $@.permissivedomains ]; then \ |
| 143 | echo "==========" 1>&2; \ |
| 144 | echo "ERROR: permissive domains not allowed in user builds" 1>&2; \ |
| 145 | echo "List of invalid domains:" 1>&2; \ |
| 146 | cat $@.permissivedomains 1>&2; \ |
| 147 | exit 1; \ |
| 148 | fi |
| 149 | $(hide) mv $@.tmp $@ |
Stephen Smalley | e60723a | 2014-05-29 16:40:15 -0400 | [diff] [blame] | 150 | |
| 151 | built_sepolicy_recovery := $(LOCAL_BUILT_MODULE) |
| 152 | sepolicy_policy_recovery.conf := |
| 153 | |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 154 | ################################## |
| 155 | include $(CLEAR_VARS) |
| 156 | |
| 157 | LOCAL_MODULE := general_sepolicy.conf |
| 158 | LOCAL_MODULE_CLASS := ETC |
| 159 | LOCAL_MODULE_TAGS := tests |
| 160 | |
| 161 | include $(BUILD_SYSTEM)/base_rules.mk |
| 162 | |
| 163 | exp_sepolicy_build_files :=\ |
Dan Willemsen | bc2a49f | 2015-08-10 15:40:52 -0700 | [diff] [blame] | 164 | $(foreach file, $(addprefix $(LOCAL_PATH)/, $(sepolicy_build_files)), $(sort $(wildcard $(file)))) |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 165 | |
| 166 | $(LOCAL_BUILT_MODULE): PRIVATE_MLS_SENS := $(MLS_SENS) |
| 167 | $(LOCAL_BUILT_MODULE): PRIVATE_MLS_CATS := $(MLS_CATS) |
| 168 | $(LOCAL_BUILT_MODULE): $(exp_sepolicy_build_files) |
| 169 | mkdir -p $(dir $@) |
| 170 | $(hide) m4 -D mls_num_sens=$(PRIVATE_MLS_SENS) -D mls_num_cats=$(PRIVATE_MLS_CATS) \ |
| 171 | -D target_build_variant=user \ |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 172 | -s $^ > $@ |
| 173 | $(hide) sed '/dontaudit/d' $@ > $@.dontaudit |
| 174 | |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 175 | built_general_sepolicy.conf := $(LOCAL_BUILT_MODULE) |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 176 | exp_sepolicy_build_files := |
| 177 | |
| 178 | ################################## |
Stephen Smalley | 01a58af | 2012-10-02 12:46:37 -0400 | [diff] [blame] | 179 | include $(CLEAR_VARS) |
| 180 | |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 181 | LOCAL_MODULE := sepolicy.general |
| 182 | LOCAL_MODULE_CLASS := ETC |
| 183 | LOCAL_MODULE_TAGS := tests |
| 184 | |
| 185 | include $(BUILD_SYSTEM)/base_rules.mk |
| 186 | |
| 187 | $(LOCAL_BUILT_MODULE): PRIVATE_BUILT_SEPOLICY.CONF := $(built_general_sepolicy.conf) |
| 188 | $(LOCAL_BUILT_MODULE): $(built_general_sepolicy.conf) $(HOST_OUT_EXECUTABLES)/checkpolicy |
| 189 | @mkdir -p $(dir $@) |
Nick Kralevich | 6ef10bd | 2016-02-29 16:59:33 -0800 | [diff] [blame] | 190 | $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -c $(POLICYVERS) -o $@ $(PRIVATE_BUILT_SEPOLICY.CONF) > /dev/null |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 191 | |
| 192 | built_general_sepolicy := $(LOCAL_BUILT_MODULE) |
| 193 | ################################## |
| 194 | include $(CLEAR_VARS) |
| 195 | |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 196 | LOCAL_MODULE := file_contexts.bin |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 197 | LOCAL_MODULE_CLASS := ETC |
| 198 | LOCAL_MODULE_TAGS := optional |
| 199 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 200 | |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 201 | include $(BUILD_SYSTEM)/base_rules.mk |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 202 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 203 | # The file_contexts.bin is built in the following way: |
| 204 | # 1. Collect all file_contexts files in THIS repository and process them with |
| 205 | # m4 into a tmp file called file_contexts.local.tmp. |
| 206 | # 2. Collect all device specific file_contexts files and process them with m4 |
| 207 | # into a tmp file called file_contexts.device.tmp. |
| 208 | # 3. Run checkfc -e (allow no device fc entries ie empty) and fc_sort on |
| 209 | # file_contexts.device.tmp and output to file_contexts.device.sorted.tmp. |
| 210 | # 4. Concatenate file_contexts.local.tmp and file_contexts.device.tmp into |
| 211 | # file_contexts.concat.tmp. |
| 212 | # 5. Run checkfc and sefcontext_compile on file_contexts.concat.tmp to produce |
| 213 | # file_contexts.bin. |
| 214 | # |
| 215 | # Note: That a newline file is placed between each file_context file found to |
| 216 | # ensure a proper build when an fc file is missing an ending newline. |
William Roberts | 29d1468 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 217 | |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 218 | local_fc_files := $(LOCAL_PATH)/file_contexts |
| 219 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
| 220 | local_fc_files := $(local_fc_files) $(LOCAL_PATH)/file_contexts_asan |
| 221 | endif |
| 222 | local_fcfiles_with_nl := $(call add_nl, $(local_fc_files), $(built_nl)) |
| 223 | |
| 224 | file_contexts.local.tmp := $(intermediates)/file_contexts.local.tmp |
| 225 | $(file_contexts.local.tmp): $(local_fcfiles_with_nl) |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 226 | @mkdir -p $(dir $@) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 227 | $(hide) m4 -s $^ > $@ |
| 228 | |
| 229 | device_fc_files := $(call build_device_policy, file_contexts) |
| 230 | device_fcfiles_with_nl := $(call add_nl, $(device_fc_files), $(built_nl)) |
| 231 | |
| 232 | file_contexts.device.tmp := $(intermediates)/file_contexts.device.tmp |
| 233 | $(file_contexts.device.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
| 234 | $(file_contexts.device.tmp): $(device_fcfiles_with_nl) |
| 235 | @mkdir -p $(dir $@) |
| 236 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@ |
| 237 | |
| 238 | file_contexts.device.sorted.tmp := $(intermediates)/file_contexts.device.sorted.tmp |
| 239 | $(file_contexts.device.sorted.tmp): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 240 | $(file_contexts.device.sorted.tmp): $(file_contexts.device.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/fc_sort $(HOST_OUT_EXECUTABLES)/checkfc |
| 241 | @mkdir -p $(dir $@) |
| 242 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -e $(PRIVATE_SEPOLICY) $< |
| 243 | $(hide) $(HOST_OUT_EXECUTABLES)/fc_sort $< $@ |
| 244 | |
| 245 | file_contexts.concat.tmp := $(intermediates)/file_contexts.concat.tmp |
| 246 | $(file_contexts.concat.tmp): $(file_contexts.local.tmp) $(file_contexts.device.sorted.tmp) |
| 247 | @mkdir -p $(dir $@) |
| 248 | $(hide) m4 -s $^ > $@ |
Stephen Smalley | 5b340be | 2012-03-06 11:12:41 -0500 | [diff] [blame] | 249 | |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 250 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 251 | $(LOCAL_BUILT_MODULE): $(file_contexts.concat.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 252 | @mkdir -p $(dir $@) |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 253 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $< |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 254 | $(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $< |
| 255 | |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 256 | built_fc := $(LOCAL_BUILT_MODULE) |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 257 | local_fc_files := |
| 258 | local_fcfiles_with_nl := |
| 259 | device_fc_files := |
| 260 | device_fcfiles_with_nl := |
| 261 | file_contexts.concat.tmp := |
| 262 | file_contexts.device.sorted.tmp := |
| 263 | file_contexts.device.tmp := |
| 264 | file_contexts.local.tmp := |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 265 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 266 | ################################## |
| 267 | include $(CLEAR_VARS) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 268 | |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 269 | LOCAL_MODULE := general_file_contexts.bin |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 270 | LOCAL_MODULE_CLASS := ETC |
| 271 | LOCAL_MODULE_TAGS := tests |
| 272 | |
| 273 | include $(BUILD_SYSTEM)/base_rules.mk |
| 274 | |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 275 | general_file_contexts.tmp := $(intermediates)/general_file_contexts.tmp |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 276 | $(general_file_contexts.tmp): $(addprefix $(LOCAL_PATH)/, file_contexts) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 277 | @mkdir -p $(dir $@) |
| 278 | $(hide) m4 -s $< > $@ |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 279 | |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 280 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
| 281 | $(LOCAL_BUILT_MODULE): $(general_file_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/sefcontext_compile $(HOST_OUT_EXECUTABLES)/checkfc |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 282 | @mkdir -p $(dir $@) |
William Roberts | 3746a0a | 2015-09-25 10:18:44 -0700 | [diff] [blame] | 283 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc $(PRIVATE_SEPOLICY) $< |
Richard Haines | c2d0191 | 2015-08-06 17:43:52 +0100 | [diff] [blame] | 284 | $(hide) $(HOST_OUT_EXECUTABLES)/sefcontext_compile -o $@ $< |
| 285 | |
| 286 | general_file_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 287 | |
| 288 | ################################## |
| 289 | include $(CLEAR_VARS) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 290 | LOCAL_MODULE := seapp_contexts |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 291 | LOCAL_MODULE_CLASS := ETC |
| 292 | LOCAL_MODULE_TAGS := optional |
| 293 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 294 | |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 295 | include $(BUILD_SYSTEM)/base_rules.mk |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 296 | |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 297 | all_sc_files := $(call build_policy, seapp_contexts) |
William Roberts | 171a062 | 2012-08-16 10:55:05 -0700 | [diff] [blame] | 298 | |
Ying Wang | d8b122c | 2012-10-25 19:01:31 -0700 | [diff] [blame] | 299 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 300 | $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILES := $(all_sc_files) |
| 301 | $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(all_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp |
William Roberts | f0e0a94 | 2012-08-27 15:41:15 -0700 | [diff] [blame] | 302 | @mkdir -p $(dir $@) |
William Roberts | 99fe8df | 2015-06-30 13:53:51 -0700 | [diff] [blame] | 303 | $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILES) |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 304 | |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 305 | built_sc := $(LOCAL_BUILT_MODULE) |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 306 | all_sc_files := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 307 | |
Ying Wang | 02fb5f3 | 2012-01-17 17:51:09 -0800 | [diff] [blame] | 308 | ################################## |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 309 | include $(CLEAR_VARS) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 310 | LOCAL_MODULE := general_seapp_contexts |
| 311 | LOCAL_MODULE_CLASS := ETC |
| 312 | LOCAL_MODULE_TAGS := tests |
| 313 | |
| 314 | include $(BUILD_SYSTEM)/base_rules.mk |
| 315 | |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 316 | all_sc_files := $(addprefix $(LOCAL_PATH)/, seapp_contexts) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 317 | |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 318 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 319 | $(LOCAL_BUILT_MODULE): PRIVATE_SC_FILE := $(all_sc_files) |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 320 | $(LOCAL_BUILT_MODULE): $(built_general_sepolicy) $(all_sc_files) $(HOST_OUT_EXECUTABLES)/checkseapp |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 321 | @mkdir -p $(dir $@) |
William Roberts | 99fe8df | 2015-06-30 13:53:51 -0700 | [diff] [blame] | 322 | $(hide) $(HOST_OUT_EXECUTABLES)/checkseapp -p $(PRIVATE_SEPOLICY) -o $@ $(PRIVATE_SC_FILE) |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 323 | |
William Roberts | 81e1f90 | 2015-06-03 21:57:47 -0700 | [diff] [blame] | 324 | all_sc_files := |
Stephen Smalley | 3771287 | 2015-03-12 15:46:36 -0400 | [diff] [blame] | 325 | |
| 326 | ################################## |
| 327 | include $(CLEAR_VARS) |
William Roberts | 4ee7131 | 2015-06-25 11:59:30 -0700 | [diff] [blame] | 328 | LOCAL_MODULE := general_seapp_neverallows |
| 329 | LOCAL_MODULE_CLASS := ETC |
| 330 | LOCAL_MODULE_TAGS := tests |
| 331 | |
| 332 | include $(BUILD_SYSTEM)/base_rules.mk |
| 333 | |
| 334 | $(LOCAL_BUILT_MODULE): $(addprefix $(LOCAL_PATH)/, seapp_contexts) |
| 335 | @mkdir -p $(dir $@) |
| 336 | - $(hide) grep -ie '^neverallow' $< > $@ |
| 337 | |
William Roberts | 4ee7131 | 2015-06-25 11:59:30 -0700 | [diff] [blame] | 338 | |
| 339 | ################################## |
| 340 | include $(CLEAR_VARS) |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 341 | |
| 342 | LOCAL_MODULE := property_contexts |
| 343 | LOCAL_MODULE_CLASS := ETC |
| 344 | LOCAL_MODULE_TAGS := optional |
| 345 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 346 | |
| 347 | include $(BUILD_SYSTEM)/base_rules.mk |
| 348 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 349 | all_pc_files := $(call build_policy, property_contexts) |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 350 | all_pcfiles_with_nl := $(call add_nl, $(all_pc_files), $(built_nl)) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 351 | |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 352 | property_contexts.tmp := $(intermediates)/property_contexts.tmp |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 353 | $(property_contexts.tmp): PRIVATE_PC_FILES := $(all_pcfiles_with_nl) |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 354 | $(property_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 355 | $(property_contexts.tmp): $(all_pcfiles_with_nl) |
William Roberts | 7f81b33 | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 356 | @mkdir -p $(dir $@) |
Colin Cross | 9eb6c87 | 2015-10-01 21:25:09 +0000 | [diff] [blame] | 357 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_PC_FILES) > $@ |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 358 | |
| 359 | |
| 360 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
William Roberts | 371918c | 2016-04-06 11:40:08 -0700 | [diff] [blame] | 361 | $(LOCAL_BUILT_MODULE): $(property_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 362 | @mkdir -p $(dir $@) |
William Roberts | 371918c | 2016-04-06 11:40:08 -0700 | [diff] [blame] | 363 | $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 364 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@ |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 365 | |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 366 | built_pc := $(LOCAL_BUILT_MODULE) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 367 | all_pc_files := |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 368 | all_pcfiles_with_nl := |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 369 | property_contexts.tmp := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 370 | |
Stephen Smalley | 124720a | 2012-04-04 10:11:16 -0400 | [diff] [blame] | 371 | ################################## |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 372 | include $(CLEAR_VARS) |
| 373 | |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 374 | LOCAL_MODULE := general_property_contexts |
| 375 | LOCAL_MODULE_CLASS := ETC |
| 376 | LOCAL_MODULE_TAGS := tests |
| 377 | |
Stephen Smalley | c936173 | 2015-03-13 09:36:57 -0400 | [diff] [blame] | 378 | include $(BUILD_SYSTEM)/base_rules.mk |
| 379 | |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 380 | general_property_contexts.tmp := $(intermediates)/general_property_contexts.tmp |
| 381 | $(general_property_contexts.tmp): $(addprefix $(LOCAL_PATH)/, property_contexts) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 382 | @mkdir -p $(dir $@) |
| 383 | $(hide) m4 -s $< > $@ |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 384 | |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 385 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
| 386 | $(LOCAL_BUILT_MODULE): $(general_property_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
| 387 | @mkdir -p $(dir $@) |
William Roberts | 371918c | 2016-04-06 11:40:08 -0700 | [diff] [blame] | 388 | $(hide) sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 389 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -p $(PRIVATE_SEPOLICY) $@ |
William Roberts | dcffd2b | 2015-09-29 13:52:37 -0700 | [diff] [blame] | 390 | |
| 391 | general_property_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 392 | |
| 393 | ################################## |
| 394 | include $(CLEAR_VARS) |
| 395 | |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 396 | LOCAL_MODULE := service_contexts |
| 397 | LOCAL_MODULE_CLASS := ETC |
| 398 | LOCAL_MODULE_TAGS := optional |
| 399 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 400 | |
| 401 | include $(BUILD_SYSTEM)/base_rules.mk |
| 402 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 403 | all_svc_files := $(call build_policy, service_contexts) |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 404 | all_svcfiles_with_nl := $(call add_nl, $(all_svc_files), $(built_nl)) |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 405 | |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 406 | service_contexts.tmp := $(intermediates)/service_contexts.tmp |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 407 | $(service_contexts.tmp): PRIVATE_SVC_FILES := $(all_svcfiles_with_nl) |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 408 | $(service_contexts.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 409 | $(service_contexts.tmp): $(all_svcfiles_with_nl) |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 410 | @mkdir -p $(dir $@) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 411 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $(PRIVATE_SVC_FILES) > $@ |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 412 | |
| 413 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_sepolicy) |
| 414 | $(LOCAL_BUILT_MODULE): $(service_contexts.tmp) $(built_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
| 415 | @mkdir -p $(dir $@) |
William Roberts | c9fce3f | 2016-04-06 11:53:04 -0700 | [diff] [blame^] | 416 | sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 417 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@ |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 418 | |
| 419 | built_svc := $(LOCAL_BUILT_MODULE) |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 420 | all_svc_files := |
William Roberts | 4674975 | 2015-12-28 15:26:20 -0800 | [diff] [blame] | 421 | all_svcfiles_with_nl := |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 422 | service_contexts.tmp := |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 423 | |
| 424 | ################################## |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 425 | include $(CLEAR_VARS) |
| 426 | |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 427 | LOCAL_MODULE := general_service_contexts |
| 428 | LOCAL_MODULE_CLASS := ETC |
| 429 | LOCAL_MODULE_TAGS := tests |
| 430 | |
| 431 | include $(BUILD_SYSTEM)/base_rules.mk |
| 432 | |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 433 | general_service_contexts.tmp := $(intermediates)/general_service_contexts.tmp |
| 434 | $(general_service_contexts.tmp): $(addprefix $(LOCAL_PATH)/, service_contexts) |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 435 | @mkdir -p $(dir $@) |
| 436 | $(hide) m4 -s $< > $@ |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 437 | |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 438 | $(LOCAL_BUILT_MODULE): PRIVATE_SEPOLICY := $(built_general_sepolicy) |
| 439 | $(LOCAL_BUILT_MODULE): $(general_service_contexts.tmp) $(built_general_sepolicy) $(HOST_OUT_EXECUTABLES)/checkfc $(ACP) |
| 440 | @mkdir -p $(dir $@) |
William Roberts | c9fce3f | 2016-04-06 11:53:04 -0700 | [diff] [blame^] | 441 | sed -e 's/#.*$$//' -e '/^$$/d' $< > $@ |
| 442 | $(hide) $(HOST_OUT_EXECUTABLES)/checkfc -s $(PRIVATE_SEPOLICY) $@ |
William Roberts | 7fc865a | 2015-09-29 14:17:38 -0700 | [diff] [blame] | 443 | |
| 444 | general_service_contexts.tmp := |
Stephen Smalley | 2e0cd5a | 2015-03-12 17:45:03 -0400 | [diff] [blame] | 445 | |
| 446 | ################################## |
| 447 | include $(CLEAR_VARS) |
| 448 | |
Robert Craig | 7f2392e | 2013-03-27 08:35:39 -0400 | [diff] [blame] | 449 | LOCAL_MODULE := mac_permissions.xml |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 450 | LOCAL_MODULE_CLASS := ETC |
| 451 | LOCAL_MODULE_TAGS := optional |
| 452 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/security |
| 453 | |
William Roberts | 2c8a55d | 2012-11-30 14:59:09 -0800 | [diff] [blame] | 454 | include $(BUILD_SYSTEM)/base_rules.mk |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 455 | |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 456 | # Build keys.conf |
| 457 | mac_perms_keys.tmp := $(intermediates)/keys.tmp |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 458 | $(mac_perms_keys.tmp): PRIVATE_ADDITIONAL_M4DEFS := $(LOCAL_ADDITIONAL_M4DEFS) |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 459 | $(mac_perms_keys.tmp): $(call build_policy, keys.conf) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 460 | @mkdir -p $(dir $@) |
William Roberts | d218558 | 2015-07-16 11:28:02 -0700 | [diff] [blame] | 461 | $(hide) m4 -s $(PRIVATE_ADDITIONAL_M4DEFS) $^ > $@ |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 462 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 463 | all_mac_perms_files := $(call build_policy, $(LOCAL_MODULE)) |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 464 | |
Shinichiro Hamaji | ef0c14d | 2016-05-13 16:04:58 +0900 | [diff] [blame] | 465 | # Should be synced with keys.conf. |
| 466 | all_keys := platform media shared testkey |
| 467 | all_keys := $(all_keys:%=$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))/%.x509.pem) |
| 468 | |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 469 | $(LOCAL_BUILT_MODULE): PRIVATE_MAC_PERMS_FILES := $(all_mac_perms_files) |
Shinichiro Hamaji | ef0c14d | 2016-05-13 16:04:58 +0900 | [diff] [blame] | 470 | $(LOCAL_BUILT_MODULE): $(mac_perms_keys.tmp) $(HOST_OUT_EXECUTABLES)/insertkeys.py $(all_mac_perms_files) $(all_keys) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 471 | @mkdir -p $(dir $@) |
Nick Kralevich | c3c9052 | 2013-10-25 12:25:36 -0700 | [diff] [blame] | 472 | $(hide) DEFAULT_SYSTEM_DEV_CERTIFICATE="$(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))" \ |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 473 | $(HOST_OUT_EXECUTABLES)/insertkeys.py -t $(TARGET_BUILD_VARIANT) -c $(TOP) $< -o $@ $(PRIVATE_MAC_PERMS_FILES) |
Geremy Condra | cd4104e | 2013-03-26 18:19:12 +0000 | [diff] [blame] | 474 | |
Robert Craig | 7f2392e | 2013-03-27 08:35:39 -0400 | [diff] [blame] | 475 | mac_perms_keys.tmp := |
William Roberts | 6aabc1c | 2015-07-30 11:44:26 -0700 | [diff] [blame] | 476 | all_mac_perms_files := |
| 477 | |
rpcraig | b19665c | 2012-07-30 09:33:03 -0400 | [diff] [blame] | 478 | ################################## |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 479 | include $(CLEAR_VARS) |
| 480 | |
| 481 | LOCAL_MODULE := selinux_version |
| 482 | LOCAL_MODULE_CLASS := ETC |
| 483 | LOCAL_MODULE_TAGS := optional |
| 484 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 485 | |
| 486 | include $(BUILD_SYSTEM)/base_rules.mk |
William Roberts | da52e85 | 2015-06-27 07:22:34 -0700 | [diff] [blame] | 487 | $(LOCAL_BUILT_MODULE): $(built_sepolicy) $(built_pc) $(built_fc) $(built_sc) $(built_svc) |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 488 | @mkdir -p $(dir $@) |
Colin Cross | 29a463d | 2015-07-17 13:08:41 -0700 | [diff] [blame] | 489 | $(hide) echo -n $(BUILD_FINGERPRINT_FROM_FILE) > $@ |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 490 | |
| 491 | ################################## |
rpcraig | 47cd396 | 2012-10-17 21:09:52 -0400 | [diff] [blame] | 492 | |
| 493 | build_policy := |
William Roberts | 49693f1 | 2016-01-04 12:20:57 -0800 | [diff] [blame] | 494 | build_device_policy := |
dcashman | 704741a | 2014-07-25 19:11:52 -0700 | [diff] [blame] | 495 | sepolicy_build_files := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 496 | built_sepolicy := |
William Roberts | 50a478e | 2015-12-28 16:19:54 -0800 | [diff] [blame] | 497 | built_sepolicy_recovery := |
Robert Craig | 8b7545b | 2014-03-20 09:35:08 -0400 | [diff] [blame] | 498 | built_sc := |
| 499 | built_fc := |
| 500 | built_pc := |
Riley Spahn | f90c41f | 2014-06-05 15:52:02 -0700 | [diff] [blame] | 501 | built_svc := |
William Roberts | b876993 | 2015-06-29 16:31:23 -0700 | [diff] [blame] | 502 | built_general_sepolicy := |
| 503 | built_general_sepolicy.conf := |
Richard Haines | c8801fe | 2015-12-11 10:39:19 +0000 | [diff] [blame] | 504 | built_nl := |
William Roberts | 50a478e | 2015-12-28 16:19:54 -0800 | [diff] [blame] | 505 | add_nl := |
Alice Chu | cdfb06f | 2012-11-01 11:33:04 -0700 | [diff] [blame] | 506 | |
| 507 | include $(call all-makefiles-under,$(LOCAL_PATH)) |