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