]> git.saurik.com Git - apple/xnu.git/blob - README
690dd7893b3b8810e91cf5947b14d17d2ccb0046
[apple/xnu.git] / README
1 How to build XNU:
2
3 1) Setup your environment:
4
5 Create and go to your sandbox directory </sandbox/my_xnu>
6
7 $ cd </sandbox/my_xnu>
8
9 Extract the xnu project from cvs:
10
11 $ cvs co -r <xnu-tag> xnu
12
13 where <xnu-tag> must be replaced by the matching xnu tag for
14 the xnu project level.
15
16 Go to the top directory in your XNU project.
17
18 $ cd </sandbox/my_xnu>/xnu
19
20 If you are using a sh-style shell, run the following command:
21 $ . SETUP/setup.sh
22
23 If you are using a csh-style shell, run the following command:
24 % source SETUP/setup.csh
25
26 This will define the following environmental variables:
27 SRCROOT, OBJROOT, DSTROOT, SYMROOT
28
29 2) Export the Component Header Files
30
31 From the top directory, run:
32
33 $ make exporthdrs
34
35 This exports the component header files in the $OBJROOT/EXPORT_HDRS
36 directory.
37
38 3) Build all the Components
39
40 From the top directory. run:
41
42 $ make all
43
44 This builds all the components for all architectures defined in
45 ARCH_CONFIGS and for all kernel configurations defined in KERNEL_CONFIGS.
46 By default, ARCH_CONFIGS contains one architecture, the build machine
47 architecture, and KERNEL_CONFIGS is set to build for RELEASE.
48 This will also create a bootable image, mach_kernel, and a kernel binary
49 with symbols, mach_kernel.sys.
50
51 Example:
52 $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component
53 $(OBJROOT)/RELEASE_PPC/mach_kernel: bootable image
54
55 4) Building a Component
56
57 From a component top directory:
58
59 $ make all
60
61 This builds a component for all architectures defined in ARCH_CONFIGS
62 and for all kernel configurations defined in KERNEL_CONFIGS.
63 By default, ARCH_CONFIGS contains one architecture, the build machine
64 architecture, and KERNEL_CONFIGS is set to build for RELEASE .
65
66 WARNING: If a component header file has been modified, you will have to do
67 the above procedures 3 and 4.
68
69 Example:
70 $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component
71
72 From the component top directory:
73
74 $ make mach_kernel
75
76 This includes your component in the bootable image, mach_kernel, and
77 in the kernel binary with symbols, mach_kernel.sys.
78
79 5) Building DEBUG
80
81 Define KERNEL_CONFIGS to DEBUG in your environment or when running a
82 make command. Then, apply procedures 4, 5
83
84 $ make KERNEL_CONFIGS=DEBUG all
85
86 or
87
88 $ export KERNEL_CONFIGS=DEBUG
89 $ make all
90
91 Example:
92 $(OBJROOT)/DEBUG_PPC/osfmk/DEBUG/osfmk.o: pre-linked object for osfmk component
93 $(OBJROOT)/DEBUG_PPC/mach_kernel: bootable image
94
95 6) Building fat
96
97 Define ARCH_CONFIGS in your environment or when running a make command.
98 Apply procedures 3, 4, 5
99
100 $ make ARCH_CONFIGS="PPC I386" exporthdrs all
101
102 or
103
104 $ export ARCH_CONFIGS="PPC I386"
105 $ make exporthdrs all
106
107 7) Build check before integration
108
109 From the top directory, run:
110
111 $ ~rc/bin/buildit . -arch ppc -arch i386 -noinstallsrc -nosum
112
113 8) Creating tags and cscope
114
115 Set up your build environment as per instructions in 2a
116
117 From the top directory, run:
118
119 $ make tags # this will build ctags and etags
120
121 $ make cscope # this will build cscope database
122