]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | How to build XNU: |
2 | ||
9bccf70c | 3 | 1) Type: "make" |
1c79356b A |
4 | |
5 | This builds all the components for all architectures defined in | |
6 | ARCH_CONFIGS and for all kernel configurations defined in KERNEL_CONFIGS. | |
7 | By default, ARCH_CONFIGS contains one architecture, the build machine | |
8 | architecture, and KERNEL_CONFIGS is set to build for RELEASE. | |
9 | This will also create a bootable image, mach_kernel, and a kernel binary | |
10 | with symbols, mach_kernel.sys. | |
11 | ||
12 | Example: | |
13 | $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component | |
14 | $(OBJROOT)/RELEASE_PPC/mach_kernel: bootable image | |
15 | ||
9bccf70c A |
16 | 2) Building a Component |
17 | ||
18 | Go to the top directory in your XNU project. | |
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 | |
1c79356b A |
28 | |
29 | From a component top directory: | |
30 | ||
31 | $ make all | |
32 | ||
33 | This builds a component for all architectures defined in ARCH_CONFIGS | |
34 | and for all kernel configurations defined in KERNEL_CONFIGS. | |
35 | By default, ARCH_CONFIGS contains one architecture, the build machine | |
36 | architecture, and KERNEL_CONFIGS is set to build for RELEASE . | |
37 | ||
1c79356b A |
38 | Example: |
39 | $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component | |
40 | ||
41 | From the component top directory: | |
42 | ||
43 | $ make mach_kernel | |
44 | ||
45 | This includes your component in the bootable image, mach_kernel, and | |
46 | in the kernel binary with symbols, mach_kernel.sys. | |
47 | ||
9bccf70c A |
48 | WARNING: If a component header file has been modified, you will have to do |
49 | the above procedure 1. | |
50 | ||
51 | 3) Building DEBUG | |
1c79356b A |
52 | |
53 | Define KERNEL_CONFIGS to DEBUG in your environment or when running a | |
54 | make command. Then, apply procedures 4, 5 | |
55 | ||
56 | $ make KERNEL_CONFIGS=DEBUG all | |
57 | ||
58 | or | |
59 | ||
60 | $ export KERNEL_CONFIGS=DEBUG | |
61 | $ make all | |
62 | ||
63 | Example: | |
64 | $(OBJROOT)/DEBUG_PPC/osfmk/DEBUG/osfmk.o: pre-linked object for osfmk component | |
65 | $(OBJROOT)/DEBUG_PPC/mach_kernel: bootable image | |
66 | ||
9bccf70c | 67 | 4) Building fat |
1c79356b A |
68 | |
69 | Define ARCH_CONFIGS in your environment or when running a make command. | |
70 | Apply procedures 3, 4, 5 | |
71 | ||
72 | $ make ARCH_CONFIGS="PPC I386" exporthdrs all | |
73 | ||
74 | or | |
75 | ||
76 | $ export ARCH_CONFIGS="PPC I386" | |
77 | $ make exporthdrs all | |
78 | ||
9bccf70c | 79 | 5) Build check before integration |
1c79356b A |
80 | |
81 | From the top directory, run: | |
82 | ||
83 | $ ~rc/bin/buildit . -arch ppc -arch i386 -noinstallsrc -nosum | |
84 | ||
9bccf70c | 85 | 6) Creating tags and cscope |
1c79356b A |
86 | |
87 | Set up your build environment as per instructions in 2a | |
88 | ||
89 | From the top directory, run: | |
90 | ||
91 | $ make tags # this will build ctags and etags | |
92 | ||
93 | $ make cscope # this will build cscope database | |
94 |