1 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
2 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
3 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
4 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
15 PRIVATE_KERNELFILES = \
18 # Available only in xnu proper
23 INSTALL_MI_LIST = ${DATAFILES}
24 INSTALL_MI_LCL_LIST = ${PRIVATE_DATAFILES}
25 INSTALL_KF_MI_LIST = ${KERNELFILES}
26 INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
28 EXPORT_MI_LIST = ${PRIVATE_XNUFILES} ${KERNELFILES} ${PRIVATE_KERNELFILES}
35 $(OBJROOT)/san/kasan-blacklist-%: $(SOURCE)/kasan-blacklist $(SOURCE)/ubsan-blacklist $(SOURCE)/kasan-blacklist-%
36 $(call makelog,$(ColorH)GENERATING$(Color0) $(ColorLF)$(notdir $@)$(Color0))
37 $(_v)sed -e 's,^src:\./,src:'"$(SRCROOT)/," $^ > $@
38 $(_v)$(SOURCE)/tools/validate_blacklist.sh "$@"
40 do_build_setup:: $(OBJROOT)/san/kasan-blacklist-x86_64 $(OBJROOT)/san/kasan-blacklist-arm64
43 # Kasan System.kext plugin
46 DSTROOT_KEXT_PATH = $(addprefix $(DSTROOT)$(INSTALL_EXTENSIONS_DIR),/System.kext/PlugIns/Kasan.kext)
47 SYMROOT_KEXT_PATH = $(addprefix $(SYMROOT),/System.kext/PlugIns/Kasan.kext)
49 ifneq ($(INSTALL_KASAN_ONLY),1)
50 DSTROOT_KEXT = $(DSTROOT_KEXT_PATH)/Kasan
51 SYMROOT_KEXT = $(SYMROOT_KEXT_PATH)/Kasan
55 DSTROOT_KEXT += $(DSTROOT_KEXT_PATH)/Kasan_kasan
56 SYMROOT_KEXT += $(SYMROOT_KEXT_PATH)/Kasan_kasan
59 # Our external dependency on allsymbols is fine because this runs in a later phase (config_install vs. config_all)
60 $(OBJPATH)/%.symbolset: $(SOURCE)/%.exports
61 $(call makelog,$(ColorH)SYMBOLSET$(Color0) $(ColorF)$*$(Color0) "($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))")
62 $(_v)$(KEXT_CREATE_SYMBOL_SET) \
63 $(ARCH_FLAGS_$(CURRENT_ARCH_CONFIG)) \
64 -import $(OBJPATH)/allsymbols \
66 -output $@ $(_vstdout)
68 $(DSTROOT_KEXT): $(DSTROOT_KEXT_PATH)/% : $(OBJPATH)/%.symbolset
69 $(_v)$(MKDIR) $(dir $@)
70 $(call makelog,$(ColorF)INSTALL$(Color0) $(ColorF)$(notdir $@)$(Color0) "($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))")
71 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
73 $(SYMROOT_KEXT): $(SYMROOT_KEXT_PATH)/% : $(DSTROOT_KEXT_PATH)/%
74 $(_v)$(MKDIR) $(dir $@)
75 $(call makelog,$(ColorF)INSTALL$(Color0) $(ColorF)$(notdir $@)$(Color0) "($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))")
76 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
78 do_config_install:: $(DSTROOT_KEXT) $(SYMROOT_KEXT)
81 # Install helper scripts
84 KASAN_HELPER_SCRIPTS += $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/kasan_install
87 $(KASAN_HELPER_SCRIPTS): $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/% : $(SOURCE)/tools/%
88 $(_v)$(MKDIR) $(dir $@)
89 $(call makelog,$(ColorH)INSTALL$(Color0) $(ColorF)$(@F)$(Color0))
90 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
92 do_config_install:: $(KASAN_HELPER_SCRIPTS)
94 include $(MakeInc_rule)
95 include $(MakeInc_dir)