]> git.saurik.com Git - apple/xnu.git/blame - config/Makefile
xnu-1228.tar.gz
[apple/xnu.git] / config / Makefile
CommitLineData
2d21ac55
A
1MAC = defined
2
d7e50217
A
3export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
4export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
5export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
6export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
7
8
9include $(MakeInc_cmd)
10include $(MakeInc_def)
11
12ALL_SUBDIRS =
13
14INSTINC_SUBDIRS =
15
16INSTINC_SUBDIRS_PPC =
17
18INSTINC_SUBDIRS_I386 =
19
2d21ac55
A
20INSTINC_SUBDIRS_ARM =
21
d7e50217
A
22EXPINC_SUBDIRS =
23
24EXPINC_SUBDIRS_PPC =
25
26EXPINC_SUBDIRS_I386 =
27
2d21ac55
A
28EXPINC_SUBDIRS_ARM =
29
d7e50217
A
30COMP_SUBDIRS =
31
32INST_SUBDIRS =
33
55e303ae 34
d7e50217 35INSTALL_DATA_LIST= \
91447636 36 IPFirewall.kext/Info.plist \
55e303ae
A
37 System.kext/Info.plist \
38 System.kext/PlugIns/Libkern.kext/Info.plist \
39 System.kext/PlugIns/Mach.kext/Info.plist \
40 System.kext/PlugIns/BSDKernel.kext/Info.plist \
2d21ac55 41 System.kext/PlugIns/MACFramework.kext/Info.plist \
55e303ae
A
42 System.kext/PlugIns/IOKit.kext/Info.plist \
43 System.kext/PlugIns/AppleNMI.kext/Info.plist \
44 System.kext/PlugIns/ApplePlatformFamily.kext/Info.plist \
45 System.kext/PlugIns/IONVRAMFamily.kext/Info.plist \
46 System.kext/PlugIns/IOSystemManagement.kext/Info.plist \
91447636 47 System.kext/PlugIns/Unsupported.kext/Info.plist \
55e303ae
A
48 \
49 System.kext/PlugIns/System6.0.kext/Info.plist \
50 System.kext/PlugIns/Libkern6.0.kext/Info.plist \
51 System.kext/PlugIns/Mach6.0.kext/Info.plist \
52 System.kext/PlugIns/BSDKernel6.0.kext/Info.plist \
53 System.kext/PlugIns/IOKit6.0.kext/Info.plist \
d7e50217
A
54
55INSTALL_DATA_DIR= \
56 /System/Library/Extensions/
57
58INSTMAN_SUBDIRS =
59
55e303ae
A
60#
61
62KEXT_CREATE_SYMBOL_SET = /usr/local/bin/kextsymboltool
91447636 63NEWVERS = $(SRCROOT)/config/newvers.pl
55e303ae 64
2d21ac55
A
65ifneq ($(MACHINE_CONFIG), DEFAULT)
66OBJPATH = $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)
67else
68OBJPATH = $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)
69endif
70
55e303ae
A
71SYMBOL_COMPONENT_LIST = \
72 System6.0 \
73 BSDKernel \
74 IOKit \
75 Libkern \
91447636
A
76 Mach \
77 Unsupported
55e303ae 78
2d21ac55
A
79ifdef MAC
80SYMBOL_COMPONENT_LIST += MACFramework
81MACFRAMEWORKEXPORTS = \
82 -export $(SRCROOT)/$(COMPONENT)/MACFramework.exports \
83 -export $(SRCROOT)/$(COMPONENT)/MACFramework.$(ARCH_CONFIG_LC).exports
84endif
85
86SYMBOL_SET_BUILD = $(foreach set, $(SYMBOL_COMPONENT_LIST), $(OBJPATH)/$(set).symbolset)
55e303ae
A
87SYMBOL_SET_FAT = $(foreach set, $(SYMBOL_COMPONENT_LIST), $(OBJROOT)/$(set).symbolset)
88
89## .SUFFIXES: .symbolset .symbollist
90
2d21ac55
A
91$(OBJPATH)/allsymbols: $(OBJPATH)/mach_kernel
92 $(_v)nm -gj $< > $@
55e303ae 93
2d21ac55
A
94$(SYMBOL_SET_BUILD): $(OBJPATH)/%.symbolset : %.exports %.$(ARCH_CONFIG_LC).exports $(OBJPATH)/allsymbols
95 $(_v)$(KEXT_CREATE_SYMBOL_SET) \
96 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
97 -import $(OBJPATH)/allsymbols \
55e303ae
A
98 -export $*.exports \
99 -export $*.$(ARCH_CONFIG_LC).exports \
100 -output $@;
101
2d21ac55
A
102ifneq ($(MACHINE_CONFIG), DEFAULT)
103$(SYMBOL_SET_FAT): $(OBJROOT)/%.symbolset : $(foreach arch, $(INSTALL_ARCHS), $(OBJROOT)/$(KERNEL_CONFIG)_$(arch)_$(MACHINE_CONFIG)/%.symbolset)
104 $(LIPO) $(foreach arch, $(INSTALL_ARCHS), $(OBJROOT)/$(KERNEL_CONFIG)_$(arch)_$(MACHINE_CONFIG)/$*.symbolset) -create -output $@;
105else
55e303ae 106$(SYMBOL_SET_FAT): $(OBJROOT)/%.symbolset : $(foreach arch, $(INSTALL_ARCHS), $(OBJROOT)/$(KERNEL_CONFIG)_$(arch)/%.symbolset)
2d21ac55
A
107 $(_v)$(LIPO) $(foreach arch, $(INSTALL_ARCHS), $(OBJROOT)/$(KERNEL_CONFIG)_$(arch)/$*.symbolset) -create -output $@;
108endif
55e303ae
A
109
110build_symbol_sets: $(SYMBOL_SET_BUILD)
2d21ac55
A
111 $(_v)$(KEXT_CREATE_SYMBOL_SET) \
112 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
113 -import $(OBJPATH)/allsymbols \
91447636
A
114 -export $(SRCROOT)/$(COMPONENT)/Libkern.exports \
115 -export $(SRCROOT)/$(COMPONENT)/Libkern.$(ARCH_CONFIG_LC).exports \
116 -export $(SRCROOT)/$(COMPONENT)/Mach.exports \
117 -export $(SRCROOT)/$(COMPONENT)/Mach.$(ARCH_CONFIG_LC).exports \
118 -export $(SRCROOT)/$(COMPONENT)/IOKit.exports \
119 -export $(SRCROOT)/$(COMPONENT)/IOKit.$(ARCH_CONFIG_LC).exports \
120 -export $(SRCROOT)/$(COMPONENT)/BSDKernel.exports \
121 -export $(SRCROOT)/$(COMPONENT)/BSDKernel.$(ARCH_CONFIG_LC).exports \
2d21ac55 122 $(MACFRAMEWORKEXPORTS) \
91447636
A
123 -export $(SRCROOT)/$(COMPONENT)/Unsupported.exports \
124 -export $(SRCROOT)/$(COMPONENT)/Unsupported.$(ARCH_CONFIG_LC).exports \
125 -output /dev/null;
126
127install_symbol_sets: $(SYMBOL_SET_FAT) $(SRCROOT)/config/MasterVersion
2d21ac55
A
128 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/System6.0.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/System6.0.kext/kernel.6.0;
129 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/BSDKernel.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/BSDKernel.kext/BSDKernel;
130ifdef MAC
131 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/MACFramework.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/MACFramework.kext/MACFramework;
132endif
133 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/IOKit.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IOKit.kext/IOKit;
134 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/Libkern.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Libkern.kext/Libkern;
135 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/Mach.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Mach.kext/Mach;
136 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/Unsupported.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Unsupported.kext/Unsupported;
137 $(_v)$(NEWVERS) $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/Info.plist \
91447636
A
138 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/AppleNMI.kext/Info.plist \
139 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/ApplePlatformFamily.kext/Info.plist \
140 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/BSDKernel.kext/Info.plist \
2d21ac55 141 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/MACFramework.kext/Info.plist \
91447636
A
142 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IOKit.kext/Info.plist \
143 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IONVRAMFamily.kext/Info.plist \
144 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/IOSystemManagement.kext/Info.plist \
145 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Libkern.kext/Info.plist \
146 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Mach.kext/Info.plist \
147 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/Unsupported.kext/Info.plist
55e303ae
A
148
149do_build_all: build_symbol_sets
150
151do_build_install: install_symbol_sets
152
d7e50217
A
153include $(MakeInc_rule)
154include $(MakeInc_dir)