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