3 1) Setup your environment:
5 Create and go to your sandbox directory </sandbox/my_xnu>
9 Extract the xnu project from cvs:
11 $ cvs co -r <xnu-tag> xnu
13 where <xnu-tag> must be replaced by the matching xnu tag for
14 the xnu project level.
16 Go to the top directory in your XNU project.
18 $ cd </sandbox/my_xnu>/xnu
20 If you are using a sh-style shell, run the following command:
23 If you are using a csh-style shell, run the following command:
24 % source SETUP/setup.csh
26 This will define the following environmental variables:
27 SRCROOT, OBJROOT, DSTROOT, SYMROOT
29 2) Export the Component Header Files
31 From the top directory, run:
35 This exports the component header files in the $OBJROOT/EXPORT_HDRS
38 3) Build all the Components
40 From the top directory. run:
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.
52 $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component
53 $(OBJROOT)/RELEASE_PPC/mach_kernel: bootable image
55 4) Building a Component
57 From a component top directory:
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 .
66 WARNING: If a component header file has been modified, you will have to do
67 the above procedures 3 and 4.
70 $(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component
72 From the component top directory:
76 This includes your component in the bootable image, mach_kernel, and
77 in the kernel binary with symbols, mach_kernel.sys.
81 Define KERNEL_CONFIGS to DEBUG in your environment or when running a
82 make command. Then, apply procedures 4, 5
84 $ make KERNEL_CONFIGS=DEBUG all
88 $ export KERNEL_CONFIGS=DEBUG
92 $(OBJROOT)/DEBUG_PPC/osfmk/DEBUG/osfmk.o: pre-linked object for osfmk component
93 $(OBJROOT)/DEBUG_PPC/mach_kernel: bootable image
97 Define ARCH_CONFIGS in your environment or when running a make command.
98 Apply procedures 3, 4, 5
100 $ make ARCH_CONFIGS="PPC I386" exporthdrs all
104 $ export ARCH_CONFIGS="PPC I386"
105 $ make exporthdrs all
107 7) Build check before integration
109 From the top directory, run:
111 $ ~rc/bin/buildit . -arch ppc -arch i386 -noinstallsrc -nosum
113 8) Creating tags and cscope
115 Set up your build environment as per instructions in 2a
117 From the top directory, run:
119 $ make tags # this will build ctags and etags
121 $ make cscope # this will build cscope database