]> git.saurik.com Git - apple/xnu.git/blame - san/Makefile
xnu-4570.71.2.tar.gz
[apple/xnu.git] / san / Makefile
CommitLineData
5ba3f43e
A
1export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
2export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
3export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
4export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
5
6include $(MakeInc_cmd)
7include $(MakeInc_def)
8
9DATAFILES = \
10
11PRIVATE_DATAFILES = \
12
13KERNELFILES = \
14
15PRIVATE_KERNELFILES = \
16 memintrinsics.h
17
18# Available only in xnu proper
19PRIVATE_XNUFILES = \
20 kasan.h
21
22INSTALL_MI_LIST = ${DATAFILES}
23INSTALL_MI_LCL_LIST = ${PRIVATE_DATAFILES}
24INSTALL_KF_MI_LIST = ${KERNELFILES}
25INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
26
27EXPORT_MI_LIST = ${PRIVATE_XNUFILES} ${KERNELFILES} ${PRIVATE_KERNELFILES}
28
29INSTALL_MI_DIR = san
30EXPORT_MI_DIR = san
31COMP_SUBDIRS = conf
32
a39ff7e2 33.DELETE_ON_ERROR:
5ba3f43e
A
34$(OBJROOT)/san/kasan-blacklist-%: $(SOURCE)/kasan-blacklist $(SOURCE)/kasan-blacklist-%
35 @echo "$(ColorH)GENERATING$(Color0) $(ColorLF)$(notdir $@)$(Color0)"
36 $(_v)sed -e 's,^src:\./,src:'"$(SRCROOT)/," $^ > $@
a39ff7e2 37 $(_v)$(SOURCE)/tools/validate_blacklist.sh "$@"
5ba3f43e 38
a39ff7e2 39do_build_setup:: $(OBJROOT)/san/kasan-blacklist-x86_64 $(OBJROOT)/san/kasan-blacklist-arm64
5ba3f43e
A
40
41#
42# Kasan System.kext plugin
43#
44
45DSTROOT_KEXT_PATH = $(addprefix $(DSTROOT)$(INSTALL_EXTENSIONS_DIR),/System.kext/PlugIns/Kasan.kext)
46SYMROOT_KEXT_PATH = $(addprefix $(SYMROOT),/System.kext/PlugIns/Kasan.kext)
47
48ifneq ($(INSTALL_KASAN_ONLY),1)
49DSTROOT_KEXT = $(DSTROOT_KEXT_PATH)/Kasan
50SYMROOT_KEXT = $(SYMROOT_KEXT_PATH)/Kasan
51endif
52
53ifeq ($(KASAN),1)
54DSTROOT_KEXT += $(DSTROOT_KEXT_PATH)/Kasan_kasan
55SYMROOT_KEXT += $(SYMROOT_KEXT_PATH)/Kasan_kasan
56endif
57
58# Our external dependency on allsymbols is fine because this runs in a later phase (config_install vs. config_all)
59$(OBJPATH)/%.symbolset: $(SOURCE)/%.exports
60 @echo "$(ColorH)SYMBOLSET$(Color0) $(ColorF)$*$(Color0) \"($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))\""
61 $(_v)$(KEXT_CREATE_SYMBOL_SET) \
62 $(ARCH_FLAGS_$(CURRENT_ARCH_CONFIG)) \
63 -import $(OBJPATH)/allsymbols \
64 -export $< \
65 -output $@ $(_vstdout)
66
67$(DSTROOT_KEXT): $(DSTROOT_KEXT_PATH)/% : $(OBJPATH)/%.symbolset
68 $(_v)$(MKDIR) $(dir $@)
69 @echo "$(ColorF)INSTALL$(Color0) $(ColorF)$(notdir $@)$(Color0) \"($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))\""
70 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
71
72$(SYMROOT_KEXT): $(SYMROOT_KEXT_PATH)/% : $(DSTROOT_KEXT_PATH)/%
73 $(_v)$(MKDIR) $(dir $@)
74 @echo "$(ColorF)INSTALL$(Color0) $(ColorF)$(notdir $@)$(Color0) \"($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))\""
75 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
76
77do_config_install:: $(DSTROOT_KEXT) $(SYMROOT_KEXT)
78
79
80# Install helper scripts
81
82ifeq ($(KASAN),1)
83KASAN_HELPER_SCRIPTS += $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/kasan_install
84endif
85
86$(KASAN_HELPER_SCRIPTS): $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/% : $(SOURCE)/tools/%
87 $(_v)$(MKDIR) $(dir $@)
88 @echo "$(ColorH)INSTALL$(Color0) $(ColorF)$(@F)$(Color0)"
89 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
90
91do_config_install:: $(KASAN_HELPER_SCRIPTS)
92
93include $(MakeInc_rule)
94include $(MakeInc_dir)