1*1b191cb5SApple OSS Distributionsexport MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd 2*1b191cb5SApple OSS Distributionsexport MakeInc_def=${SRCROOT}/makedefs/MakeInc.def 3*1b191cb5SApple OSS Distributionsexport MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule 4*1b191cb5SApple OSS Distributionsexport MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir 5*1b191cb5SApple OSS Distributionsexport MakeInc_san=${SRCROOT}/makedefs/MakeInc.san 6*1b191cb5SApple OSS Distributions 7*1b191cb5SApple OSS Distributionsinclude $(MakeInc_cmd) 8*1b191cb5SApple OSS Distributionsinclude $(MakeInc_def) 9*1b191cb5SApple OSS Distributionsinclude $(MakeInc_san) 10*1b191cb5SApple OSS Distributions 11*1b191cb5SApple OSS DistributionsDATAFILES = \ 12*1b191cb5SApple OSS Distributions 13*1b191cb5SApple OSS DistributionsPRIVATE_DATAFILES = \ 14*1b191cb5SApple OSS Distributions 15*1b191cb5SApple OSS DistributionsKERNELFILES = \ 16*1b191cb5SApple OSS Distributions 17*1b191cb5SApple OSS DistributionsPRIVATE_KERNELFILES = \ 18*1b191cb5SApple OSS Distributions 19*1b191cb5SApple OSS Distributions# Available only in xnu proper 20*1b191cb5SApple OSS DistributionsPRIVATE_XNUFILES = \ 21*1b191cb5SApple OSS Distributions kcov.h \ 22*1b191cb5SApple OSS Distributions kcov_data.h \ 23*1b191cb5SApple OSS Distributions kcov_ksancov.h \ 24*1b191cb5SApple OSS Distributions kcov_ksancov_data.h \ 25*1b191cb5SApple OSS Distributions kcov_stksz.h \ 26*1b191cb5SApple OSS Distributions kcov_stksz_data.h 27*1b191cb5SApple OSS Distributions 28*1b191cb5SApple OSS DistributionsINSTALL_MI_LIST = ${DATAFILES} 29*1b191cb5SApple OSS DistributionsINSTALL_SF_MI_LCL_LIST = ${DATAFILES} ${PRIVATE_DATAFILES} 30*1b191cb5SApple OSS DistributionsINSTALL_KF_MI_LIST = ${KERNELFILES} 31*1b191cb5SApple OSS DistributionsINSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES} 32*1b191cb5SApple OSS Distributions 33*1b191cb5SApple OSS DistributionsEXPORT_MI_LIST = ${PRIVATE_XNUFILES} ${KERNELFILES} ${PRIVATE_KERNELFILES} 34*1b191cb5SApple OSS Distributions 35*1b191cb5SApple OSS DistributionsINSTALL_MI_DIR = san 36*1b191cb5SApple OSS DistributionsEXPORT_MI_DIR = san 37*1b191cb5SApple OSS Distributions 38*1b191cb5SApple OSS Distributions# Generate blacklist 39*1b191cb5SApple OSS Distributions.DELETE_ON_ERROR: 40*1b191cb5SApple OSS Distributions$(OBJROOT)/san/kcov-blacklist-%: $(SOURCE)/kcov-blacklist $(SOURCE)/kcov-blacklist-% 41*1b191cb5SApple OSS Distributions @$(LOG_GENERATE) "$(notdir $@)" 42*1b191cb5SApple OSS Distributions $(_v)sed -e 's,^src:\./,src:'"$(SRCROOT)/," $^ > $@ 43*1b191cb5SApple OSS Distributions $(_v)$(SRCROOT)/san/tools/validate_blacklist.sh "$@" 44*1b191cb5SApple OSS Distributions 45*1b191cb5SApple OSS Distributionsdo_build_setup:: $(OBJROOT)/san/kcov-blacklist-x86_64 $(OBJROOT)/san/kcov-blacklist-arm64 46*1b191cb5SApple OSS Distributions 47*1b191cb5SApple OSS Distributions# 48*1b191cb5SApple OSS Distributions# Kcov System.kext plugin 49*1b191cb5SApple OSS Distributions# 50*1b191cb5SApple OSS Distributions 51*1b191cb5SApple OSS Distributionsifneq ($(RC_ProjectName),xnu_libraries) 52*1b191cb5SApple OSS Distributions 53*1b191cb5SApple OSS Distributions# 54*1b191cb5SApple OSS Distributions# Primary build will always install kext without exported runtime. 55*1b191cb5SApple OSS Distributions# 56*1b191cb5SApple OSS Distributions# Note: Skipped when kasan only install is requested. 57*1b191cb5SApple OSS Distributions# 58*1b191cb5SApple OSS Distributions 59*1b191cb5SApple OSS Distributionsifneq ($(INSTALL_KASAN_ONLY),1) 60*1b191cb5SApple OSS Distributions 61*1b191cb5SApple OSS DistributionsKEXT := Kcov 62*1b191cb5SApple OSS Distributions 63*1b191cb5SApple OSS Distributions$(eval $(call san_symbolset_template,$(KEXT),Kcov_disabled)) 64*1b191cb5SApple OSS Distributions$(eval $(call san_kext_dstroot_rule_template,Kcov.kext,$(KEXT))) 65*1b191cb5SApple OSS Distributions$(eval $(call san_kext_symroot_rule_template,Kcov.kext,$(KEXT),$(BUILD_CONFIGS))) 66*1b191cb5SApple OSS Distributions 67*1b191cb5SApple OSS Distributionsdo_config_all:: $(SYMBOL_SET_BUILD_$(KEXT)) 68*1b191cb5SApple OSS Distributionsdo_config_install:: $(SYMROOT_KEXT_$(KEXT)) $(DSTROOT_KEXT_$(KEXT)) 69*1b191cb5SApple OSS Distributions 70*1b191cb5SApple OSS Distributionsendif 71*1b191cb5SApple OSS Distributions 72*1b191cb5SApple OSS Distributions# 73*1b191cb5SApple OSS Distributions# Non-primary build variant install target. 74*1b191cb5SApple OSS Distributions# 75*1b191cb5SApple OSS Distributions# Include variant only when sanitizer runtime is enabled. 76*1b191cb5SApple OSS Distributions# 77*1b191cb5SApple OSS Distributions 78*1b191cb5SApple OSS Distributionsifneq ($(filter $(CURRENT_KERNEL_CONFIG), $(KCOV_RUNTIME)),) 79*1b191cb5SApple OSS Distributions 80*1b191cb5SApple OSS Distributions# all build configs for the current variant 81*1b191cb5SApple OSS DistributionsCURRENT_VARIANT_BUILD_CONFIGS := $(strip $(call function_match_build_config_for_kernel_config, \ 82*1b191cb5SApple OSS Distributions $(BUILD_CONFIGS), $(CURRENT_KERNEL_CONFIG))) 83*1b191cb5SApple OSS Distributions 84*1b191cb5SApple OSS DistributionsKEXT_VARIANT := Kcov_$(CURRENT_KERNEL_CONFIG_LC) 85*1b191cb5SApple OSS Distributions 86*1b191cb5SApple OSS Distributions$(eval $(call san_symbolset_template,$(KEXT_VARIANT),Kcov_enabled)) 87*1b191cb5SApple OSS Distributions$(eval $(call san_kext_dstroot_rule_template,Kcov.kext,$(KEXT_VARIANT))) 88*1b191cb5SApple OSS Distributions$(eval $(call san_kext_symroot_rule_template,Kcov.kext,$(KEXT_VARIANT),$(CURRENT_VARIANT_BUILD_CONFIGS))) 89*1b191cb5SApple OSS Distributions 90*1b191cb5SApple OSS Distributionsdo_config_all:: $(SYMBOL_SET_BUILD_$(KEXT_VARIANT)) 91*1b191cb5SApple OSS Distributionsdo_config_install_variant:: $(SYMROOT_KEXT_$(KEXT_VARIANT)) $(DSTROOT_KEXT_$(KEXT_VARIANT)) 92*1b191cb5SApple OSS Distributions 93*1b191cb5SApple OSS Distributionsendif 94*1b191cb5SApple OSS Distributions 95*1b191cb5SApple OSS Distributionselse 96*1b191cb5SApple OSS Distributions# We are building XNU as a static library - no need for the symbol kexts 97*1b191cb5SApple OSS Distributionsendif 98*1b191cb5SApple OSS Distributions 99*1b191cb5SApple OSS Distributionsinclude $(MakeInc_rule) 100*1b191cb5SApple OSS Distributionsinclude $(MakeInc_dir) 101