]> git.saurik.com Git - apple/xnu.git/blob - config/Makefile
xnu-1228.12.14.tar.gz
[apple/xnu.git] / config / Makefile
1 MAC = defined
2
3 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
4 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
5 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
6 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
7
8
9 include $(MakeInc_cmd)
10 include $(MakeInc_def)
11
12 ALL_SUBDIRS =
13
14 INSTINC_SUBDIRS =
15
16 INSTINC_SUBDIRS_PPC =
17
18 INSTINC_SUBDIRS_I386 =
19
20 INSTINC_SUBDIRS_ARM =
21
22 EXPINC_SUBDIRS =
23
24 EXPINC_SUBDIRS_PPC =
25
26 EXPINC_SUBDIRS_I386 =
27
28 EXPINC_SUBDIRS_ARM =
29
30 COMP_SUBDIRS =
31
32 INST_SUBDIRS =
33
34
35 INSTALL_DATA_LIST= \
36 IPFirewall.kext/Info.plist \
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 \
41 System.kext/PlugIns/MACFramework.kext/Info.plist \
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 \
47 System.kext/PlugIns/Unsupported.kext/Info.plist \
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 \
54
55 INSTALL_DATA_DIR= \
56 /System/Library/Extensions/
57
58 INSTMAN_SUBDIRS =
59
60 #
61
62 KEXT_CREATE_SYMBOL_SET = /usr/local/bin/kextsymboltool
63 NEWVERS = $(SRCROOT)/config/newvers.pl
64
65 ifneq ($(MACHINE_CONFIG), DEFAULT)
66 OBJPATH = $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)
67 else
68 OBJPATH = $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)
69 endif
70
71 SYMBOL_COMPONENT_LIST = \
72 System6.0 \
73 BSDKernel \
74 IOKit \
75 Libkern \
76 Mach \
77 Unsupported
78
79 ifdef MAC
80 SYMBOL_COMPONENT_LIST += MACFramework
81 MACFRAMEWORKEXPORTS = \
82 -export $(SRCROOT)/$(COMPONENT)/MACFramework.exports \
83 -export $(SRCROOT)/$(COMPONENT)/MACFramework.$(ARCH_CONFIG_LC).exports
84 endif
85
86 SYMBOL_SET_BUILD = $(foreach set, $(SYMBOL_COMPONENT_LIST), $(OBJPATH)/$(set).symbolset)
87 SYMBOL_SET_FAT = $(foreach set, $(SYMBOL_COMPONENT_LIST), $(OBJROOT)/$(set).symbolset)
88
89 ## .SUFFIXES: .symbolset .symbollist
90
91 $(OBJPATH)/allsymbols: $(OBJPATH)/mach_kernel
92 $(_v)nm -gj $< > $@
93
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_ALL_)) \
97 -import $(OBJPATH)/allsymbols \
98 -export $*.exports \
99 -export $*.$(ARCH_CONFIG_LC).exports \
100 -output $@;
101
102 ifneq ($(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 $@;
105 else
106 $(SYMBOL_SET_FAT): $(OBJROOT)/%.symbolset : $(foreach arch, $(INSTALL_ARCHS), $(OBJROOT)/$(KERNEL_CONFIG)_$(arch)/%.symbolset)
107 $(_v)$(LIPO) $(foreach arch, $(INSTALL_ARCHS), $(OBJROOT)/$(KERNEL_CONFIG)_$(arch)/$*.symbolset) -create -output $@;
108 endif
109
110 build_symbol_sets: $(SYMBOL_SET_BUILD)
111 $(_v)$(KEXT_CREATE_SYMBOL_SET) \
112 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_ALL_)) \
113 -import $(OBJPATH)/allsymbols \
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 \
122 $(MACFRAMEWORKEXPORTS) \
123 -export $(SRCROOT)/$(COMPONENT)/Unsupported.exports \
124 -export $(SRCROOT)/$(COMPONENT)/Unsupported.$(ARCH_CONFIG_LC).exports \
125 -output /dev/null;
126
127 install_symbol_sets: $(SYMBOL_SET_FAT) $(SRCROOT)/config/MasterVersion
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;
130 ifdef MAC
131 $(_v)install $(INSTALL_FLAGS) $(OBJROOT)/MACFramework.symbolset $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/MACFramework.kext/MACFramework;
132 endif
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 \
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 \
141 $(DSTROOT)/$(INSTALL_DATA_DIR)/System.kext/PlugIns/MACFramework.kext/Info.plist \
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
148
149 do_build_all: build_symbol_sets
150
151 do_build_install: install_symbol_sets
152
153 include $(MakeInc_rule)
154 include $(MakeInc_dir)