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