-MAC = defined
-
export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
ALL_SUBDIRS =
INSTINC_SUBDIRS =
-
-INSTINC_SUBDIRS_PPC =
-
INSTINC_SUBDIRS_I386 =
-
INSTINC_SUBDIRS_X86_64 =
-
INSTINC_SUBDIRS_ARM =
EXPINC_SUBDIRS =
-
-EXPINC_SUBDIRS_PPC =
-
EXPINC_SUBDIRS_I386 =
-
EXPINC_SUBDIRS_X86_64 =
-
EXPINC_SUBDIRS_ARM =
+
COMP_SUBDIRS =
INST_SUBDIRS =
-INSTALL_DATA_LIST= \
+INSTALL_KEXT_PLIST_LIST= \
System.kext/Info.plist \
System.kext/PlugIns/Libkern.kext/Info.plist \
System.kext/PlugIns/Mach.kext/Info.plist \
System.kext/PlugIns/IONVRAMFamily.kext/Info.plist \
System.kext/PlugIns/IOSystemManagement.kext/Info.plist \
System.kext/PlugIns/Unsupported.kext/Info.plist \
- System.kext/PlugIns/Private.kext/Info.plist \
- \
- System.kext/PlugIns/System6.0.kext/Info.plist \
- System.kext/PlugIns/Libkern6.0.kext/Info.plist \
- System.kext/PlugIns/Mach6.0.kext/Info.plist \
- System.kext/PlugIns/BSDKernel6.0.kext/Info.plist \
- System.kext/PlugIns/IOKit6.0.kext/Info.plist \
+ System.kext/PlugIns/Private.kext/Info.plist
-INSTALL_DATA_DIR= \
- /System/Library/Extensions/
+INSTALL_KEXT_DIR = /System/Library/Extensions/
-INSTMAN_SUBDIRS =
MD_SUPPORTED_KPI_FILENAME="SupportedKPIs-${ARCH_CONFIG_LC}.txt"
MI_SUPPORTED_KPI_FILENAME="SupportedKPIs-all-archs.txt"
ifeq ($(ARCH_CONFIG),I386)
SUPPORT_SYSTEM60_KEXT = 1
-else ifeq ($(ARCH_CONFIG),ARM)
-SUPPORT_SYSTEM60_KEXT = 1
else
SUPPORT_SYSTEM60_KEXT = 0
endif
+ifeq ($(SUPPORT_SYSTEM60_KEXT),1)
+INSTALL_KEXT_PLIST_LIST += \
+ System.kext/PlugIns/System6.0.kext/Info.plist \
+ System.kext/PlugIns/Libkern6.0.kext/Info.plist \
+ System.kext/PlugIns/Mach6.0.kext/Info.plist \
+ System.kext/PlugIns/BSDKernel6.0.kext/Info.plist \
+ System.kext/PlugIns/IOKit6.0.kext/Info.plist
+endif
+
SYMBOL_COMPONENT_LIST = \
System6.0 \
BSDKernel \
IOKit \
- Libkern \
- Mach \
- Unsupported \
- Private
-
-ifdef MAC
-SYMBOL_COMPONENT_LIST += MACFramework
-MACFRAMEWORKEXPORTS = \
- -export $(SRCROOT)/$(COMPONENT)/MACFramework.exports \
- -export $(SRCROOT)/$(COMPONENT)/MACFramework.$(ARCH_CONFIG_LC).exports
-endif
+ Libkern \
+ Mach \
+ MACFramework \
+ Unsupported \
+ Private
SYMBOL_SET_BUILD = $(foreach set, $(SYMBOL_COMPONENT_LIST), $(OBJPATH)/$(set).symbolset)
SYMBOL_SET_FAT = $(foreach set, $(SYMBOL_COMPONENT_LIST), $(OBJROOT)/$(set).symbolset)
-## .SUFFIXES: .symbolset .symbollist
+INSTALL_KEXT_PLISTS = $(addprefix $(DSTROOT)$(INSTALL_KEXT_DIR), $(INSTALL_KEXT_PLIST_LIST))
+
+$(INSTALL_KEXT_PLISTS): $(DSTROOT)$(INSTALL_KEXT_DIR)% : $(SOURCE)/%
+ @echo Install $< in $@
+ $(_v)$(MKDIR) $(dir $@); \
+ $(RM) $(RMFLAGS) $@; \
+ $(INSTALL) $(DATA_INSTALL_FLAGS) $< $(dir $@)
$(OBJPATH)/allsymbols: $(OBJPATH)/mach_kernel
$(_v)$(NM) -gj $< > $@
printf "" > $@; \
fi
-build_symbol_sets: $(SYMBOL_SET_BUILD)
+build_symbol_sets: $(SYMBOL_SET_BUILD) $(OBJPATH)/allsymbols
$(_v)$(KEXT_CREATE_SYMBOL_SET) \
$($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_ALL_)) \
+ $(foreach comp,$(filter-out System6.0 Private,$(SYMBOL_COMPONENT_LIST)), \
+ -export $(SRCROOT)/$(COMPONENT)/$(comp).exports \
+ -export $(SRCROOT)/$(COMPONENT)/$(comp).$(ARCH_CONFIG_LC).exports) \
-import $(OBJPATH)/allsymbols \
- -export $(SRCROOT)/$(COMPONENT)/Libkern.exports \
- -export $(SRCROOT)/$(COMPONENT)/Libkern.$(ARCH_CONFIG_LC).exports \
- -export $(SRCROOT)/$(COMPONENT)/Mach.exports \
- -export $(SRCROOT)/$(COMPONENT)/Mach.$(ARCH_CONFIG_LC).exports \
- -export $(SRCROOT)/$(COMPONENT)/IOKit.exports \
- -export $(SRCROOT)/$(COMPONENT)/IOKit.$(ARCH_CONFIG_LC).exports \
- -export $(SRCROOT)/$(COMPONENT)/BSDKernel.exports \
- -export $(SRCROOT)/$(COMPONENT)/BSDKernel.$(ARCH_CONFIG_LC).exports \
- $(MACFRAMEWORKEXPORTS) \
- -export $(SRCROOT)/$(COMPONENT)/Unsupported.exports \
- -export $(SRCROOT)/$(COMPONENT)/Unsupported.$(ARCH_CONFIG_LC).exports \
-output /dev/null $(_vstdout);
$(_v)$(KEXT_CREATE_SYMBOL_SET) \
- $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
+ $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_ALL_)) \
+ $(foreach comp,$(filter-out System6.0 Unsupported,$(SYMBOL_COMPONENT_LIST)), \
+ -export $(SRCROOT)/$(COMPONENT)/$(comp).exports \
+ -export $(SRCROOT)/$(COMPONENT)/$(comp).$(ARCH_CONFIG_LC).exports) \
-import $(OBJPATH)/allsymbols \
- -export $(SRCROOT)/$(COMPONENT)/Libkern.exports \
- -export $(SRCROOT)/$(COMPONENT)/Libkern.$(ARCH_CONFIG_LC).exports \
- -export $(SRCROOT)/$(COMPONENT)/Mach.exports \
- -export $(SRCROOT)/$(COMPONENT)/Mach.$(ARCH_CONFIG_LC).exports \
- -export $(SRCROOT)/$(COMPONENT)/IOKit.exports \
- -export $(SRCROOT)/$(COMPONENT)/IOKit.$(ARCH_CONFIG_LC).exports \
- -export $(SRCROOT)/$(COMPONENT)/BSDKernel.exports \
- -export $(SRCROOT)/$(COMPONENT)/BSDKernel.$(ARCH_CONFIG_LC).exports \
- $(MACFRAMEWORKEXPORTS) \
- -export $(SRCROOT)/$(COMPONENT)/Private.exports \
- -export $(SRCROOT)/$(COMPONENT)/Private.$(ARCH_CONFIG_LC).exports \
-output /dev/null $(_vstdout);
$(_v) $(SRCROOT)/$(COMPONENT)/list_supported.sh $(SRCROOT)/$(COMPONENT) $(ARCH_CONFIG_LC) $(OBJPATH)/${MD_SUPPORTED_KPI_FILENAME};
$(_v)if [ -n `echo $${ARCH_CONFIGS%%\ *} | grep -i $(ARCH_CONFIG)` ]; \
fi
-install_symbol_sets: $(SYMBOL_SET_FAT) $(SRCROOT)/config/MasterVersion
- $(_v)if [ -s "$(OBJROOT)/System6.0.symbolset" ]; then \
- install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/System6.0.kext/kernel.6.0; \
- install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Mach6.0.kext/Mach6.0; \
- install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/BSDKernel6.0.kext/BSDKernel6.0; \
- install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Libkern6.0.kext/Libkern6.0; \
- install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IOKit6.0.kext/IOKit6.0; \
+install_symbol_sets: $(SYMBOL_SET_FAT) $(SRCROOT)/config/MasterVersion $(INSTALL_KEXT_PLISTS)
+ $(_v)if [ -s "$(OBJROOT)/System6.0.symbolset" -a $(SUPPORT_SYSTEM60_KEXT) -eq 1 ]; then \
+ install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/System6.0.kext/kernel.6.0; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Mach6.0.kext/Mach6.0; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/BSDKernel6.0.kext/BSDKernel6.0; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Libkern6.0.kext/Libkern6.0; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/IOKit6.0.kext/IOKit6.0; \
fi
- $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/BSDKernel.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/BSDKernel.kext/BSDKernel;
- $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/IOKit.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IOKit.kext/IOKit;
- $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/Libkern.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Libkern.kext/Libkern;
- $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/Mach.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Mach.kext/Mach;
- $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/Unsupported.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Unsupported.kext/Unsupported;
- $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/Private.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Private.kext/Private;
- $(_v)$(NEWVERS) $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/AppleNMI.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/ApplePlatformFamily.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/BSDKernel.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IOKit.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IONVRAMFamily.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IOSystemManagement.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Libkern.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Mach.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Unsupported.kext/Info.plist \
- $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Private.kext/Info.plist;
+ $(_v)if [ -s "$(OBJROOT)/BSDKernel.symbolset" ]; then \
+ install $(INSTALL_FLAGS) $(OBJROOT)/BSDKernel.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/BSDKernel.kext/BSDKernel; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/IOKit.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/IOKit.kext/IOKit; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/Libkern.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Libkern.kext/Libkern; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/Mach.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Mach.kext/Mach; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/MACFramework.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/MACFramework.kext/MACFramework; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/Unsupported.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Unsupported.kext/Unsupported; \
+ install $(INSTALL_FLAGS) $(OBJROOT)/Private.symbolset $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Private.kext/Private; \
+ fi
+ $(_v)$(NEWVERS) $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/AppleNMI.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/ApplePlatformFamily.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/BSDKernel.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/IOKit.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/IONVRAMFamily.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/IOSystemManagement.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Libkern.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Mach.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/MACFramework.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Unsupported.kext/Info.plist \
+ $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext/PlugIns/Private.kext/Info.plist;
$(_v)$(MKDIR) $(DSTROOT)/$(KRESDIR);
$(_v)install $(INSTALL_FLAGS) $(OBJPATH)/$(MD_SUPPORTED_KPI_FILENAME) $(DSTROOT)/$(KRESDIR);
$(_v)if [ -n `echo $${ARCH_CONFIGS%%\ *} | grep -i $(ARCH_CONFIG)` ]; then \
install $(INSTALL_FLAGS) $(OBJROOT)/$(MI_SUPPORTED_KPI_FILENAME) $(DSTROOT)/$(KRESDIR); \
fi
-ifdef MAC
- $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/MACFramework.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/MACFramework.kext/MACFramework;
- $(_v)$(NEWVERS) $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/MACFramework.kext/Info.plist
-endif
- $(_v)$(CP) -rf $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext $(SYMROOT)
+ $(_v)$(MKDIR) $(SYMROOT)
+ $(_v)$(CP) -rf $(DSTROOT)/$(INSTALL_KEXT_DIR)/System.kext $(SYMROOT)
do_build_all: build_symbol_sets
do_build_install: install_symbol_sets
+EXPORTS_FILE_LIST = $(addprefix $(SOURCE)/,$(foreach set,$(SYMBOL_COMPONENT_LIST), $(set).exports $(set).$(ARCH_CONFIG_LC).exports))
+EXPORTS_FILE_LIST_NOSYSTEM60 = $(addprefix $(SOURCE)/,$(foreach set, $(filter-out System6.0,$(SYMBOL_COMPONENT_LIST)), $(set).exports $(set).$(ARCH_CONFIG_LC).exports))
+
+# Does not include "whole-kernel" clients
+build_mach_kernel_exports:
+ $(_v)if [ $(SUPPORT_SYSTEM60_KEXT) -eq 1 ]; then \
+ $(SOURCE)/generate_linker_exports.sh $(OBJPATH)/kernel-kpi.exp \
+ $(EXPORTS_FILE_LIST) || exit 1; \
+ else \
+ $(SOURCE)/generate_linker_exports.sh $(OBJPATH)/kernel-kpi.exp \
+ $(EXPORTS_FILE_LIST_NOSYSTEM60) || exit 1; \
+ fi;
+
include $(MakeInc_rule)
include $(MakeInc_dir)