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