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