xref: /haiku/src/system/boot/loader/Jamfile (revision cb837539f5d245cedff238f8894c0ae326c2eaf5)
1SubDir HAIKU_TOP src system boot loader ;
2
3SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems amiga ;
4SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems apple ;
5SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems gpt ;
6SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems intel ;
7UsePrivateKernelHeaders ;
8UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
9UsePrivateHeaders [ FDirName kernel util ] ;
10UsePrivateHeaders shared storage ;
11
12local defines = $(DEFINES) ;
13
14local platform ;
15for platform in [ MultiBootSubDirSetup ] {
16	on $(platform) {
17		{
18			DEFINES = $(defines) ;
19
20			DEFINES +=
21				_BOOT_MODE
22				BOOT_ARCH=\\\"$(TARGET_KERNEL_ARCH)\\\"
23				KMESSAGE_CONTAINER_ONLY
24
25				BOOT_SUPPORT_PARTITION_INTEL
26
27				BOOT_SUPPORT_FILE_SYSTEM_BFS
28				BOOT_SUPPORT_FILE_SYSTEM_TARFS
29				#BOOT_SUPPORT_FILE_MAP_DISK
30				BOOT_SUPPORT_FILE_SYSTEM_FAT
31			;
32
33			# Add architecture specific partition/file system modules
34
35			switch $(TARGET_KERNEL_ARCH) {
36				case "ppc" :
37				{
38					DEFINES +=
39						BOOT_SUPPORT_ELF32 #How to deal with PPC970 ?
40						BOOT_SUPPORT_PARTITION_AMIGA
41						BOOT_SUPPORT_PARTITION_APPLE
42
43						BOOT_SUPPORT_FILE_SYSTEM_AMIGA_FFS
44					;
45				}
46				case "x86" :
47				{
48					DEFINES +=
49						ALTERNATE_BOOT_ARCH=\\\"x86_64\\\"
50						BOOT_SUPPORT_ELF64
51
52						BOOT_SUPPORT_PARTITION_EFI
53
54						#BOOT_SUPPORT_FILE_SYSTEM_FAT
55					;
56					if $(TARGET_BOOT_PLATFORM) = efi {
57						DEFINES +=
58							_BOOT_PLATFORM_EFI
59						;
60					} else {
61						DEFINES += BOOT_SUPPORT_ELF32 ;
62					}
63				}
64				case "sparc" :
65				{
66					DEFINES +=
67						BOOT_SUPPORT_ELF64
68					;
69				}
70				case "risc-v" :
71				{
72					DEFINES +=
73						BOOT_SUPPORT_ELF64
74					;
75				}
76				case "m68k" :
77				{
78					DEFINES += BOOT_SUPPORT_ELF32 ;
79				}
80				case "arm" :
81				{
82					DEFINES += BOOT_SUPPORT_ELF32 ;
83					if $(TARGET_BOOT_PLATFORM) = efi {
84						DEFINES +=
85							_BOOT_PLATFORM_EFI
86						;
87					}
88				}
89			}
90
91			local kernelC++Header = [ FDirName $(HAIKU_TOP) headers private kernel util
92				kernel_cpp.h ] ;
93
94			SubDirC++Flags -fno-rtti -include $(kernelC++Header) ;
95		}
96
97
98		BootStaticLibrary [ MultiBootGristFiles boot_loader ] :
99			PathBlacklist.cpp
100			elf.cpp
101			heap.cpp
102			kernel_args.cpp
103			load_driver_settings.cpp
104			loader.cpp
105			main.cpp
106			menu.cpp
107			package_support.cpp
108			pager.cpp
109			partitions.cpp
110			RootFileSystem.cpp
111			stdio.cpp
112			vfs.cpp
113			vm.cpp
114
115			# libroot
116			driver_settings.cpp
117
118			# utils
119			kernel_cpp.cpp
120			KMessage.cpp
121			list.cpp
122			ring_buffer.cpp
123			safemode_settings.cpp
124			StringHash.cpp
125
126			DataIO.cpp
127			Referenceable.cpp
128			;
129
130		# The partition support is built in an extra static library
131		# so that only the ones that are used will be included.
132
133		BootStaticLibrary [ MultiBootGristFiles boot_partitions ] :
134			FileMapDisk.cpp
135			amiga_rdb.cpp
136			apple.cpp
137
138			gpt.cpp
139			Header.cpp
140			crc32.cpp
141			utility.cpp
142
143			intel.cpp
144			PartitionMap.cpp
145			PartitionMapParser.cpp
146			;
147
148		# Tell Jam where to find the utility sources
149		SEARCH on [ FGristFiles kernel_cpp.cpp list.cpp ring_buffer.cpp StringHash.cpp ]
150			= [ FDirName $(HAIKU_TOP) src system kernel util ] ;
151
152		SEARCH on [ FGristFiles KMessage.cpp ]
153			= [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;
154
155		SEARCH on [ FGristFiles safemode_settings.cpp ]
156			= [ FDirName $(HAIKU_TOP) src system kernel debug ] ;
157
158		SEARCH on [ FGristFiles driver_settings.cpp ]
159			= [ FDirName $(HAIKU_TOP) src system libroot os ] ;
160
161		SEARCH on [ FGristFiles amiga_rdb.cpp ]
162			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems amiga ] ;
163
164		SEARCH on [ FGristFiles apple.cpp ]
165			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems apple ] ;
166
167		SEARCH on [ FGristFiles gpt.cpp Header.cpp crc32.cpp utility.cpp ]
168			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems gpt ] ;
169
170		SEARCH on [ FGristFiles intel.cpp PartitionMap.cpp PartitionMapParser.cpp ]
171			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems intel ] ;
172
173		SEARCH on [ FGristFiles stage2_crt0.S ]
174			= [ FDirName $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ] ;
175
176		SEARCH on [ FGristFiles DataIO.cpp Referenceable.cpp ]
177			= [ FDirName $(HAIKU_TOP) src kits support ] ;
178	}
179}
180
181SubInclude HAIKU_TOP src system boot loader file_systems ;
182SubInclude HAIKU_TOP src system boot loader net ;
183