xref: /haiku/src/system/boot/loader/Jamfile (revision abba71575e34f84c3d75be9d29d6e6caa6c033db)
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			}
87
88			local kernelC++Header = [ FDirName $(HAIKU_TOP) headers private kernel util
89				kernel_cpp.h ] ;
90
91			SubDirC++Flags -fno-rtti -include $(kernelC++Header) ;
92		}
93
94
95		BootStaticLibrary [ MultiBootGristFiles boot_loader ] :
96			PathBlocklist.cpp
97			elf.cpp
98			heap.cpp
99			kernel_args.cpp
100			load_driver_settings.cpp
101			loader.cpp
102			main.cpp
103			menu.cpp
104			package_support.cpp
105			pager.cpp
106			partitions.cpp
107			RootFileSystem.cpp
108			stdio.cpp
109			vfs.cpp
110			vm.cpp
111
112			# libroot
113			driver_settings.cpp
114
115			# utils
116			kernel_cpp.cpp
117			KMessage.cpp
118			list.cpp
119			ring_buffer.cpp
120			safemode_settings.cpp
121			StringHash.cpp
122
123			DataIO.cpp
124			Referenceable.cpp
125			;
126
127		# The partition support is built in an extra static library
128		# so that only the ones that are used will be included.
129
130		BootStaticLibrary [ MultiBootGristFiles boot_partitions ] :
131			FileMapDisk.cpp
132			amiga_rdb.cpp
133			apple.cpp
134
135			gpt.cpp
136			Header.cpp
137			crc32.cpp
138			utility.cpp
139
140			intel.cpp
141			PartitionMap.cpp
142			PartitionMapParser.cpp
143			;
144
145		# Tell Jam where to find the utility sources
146		SEARCH on [ FGristFiles kernel_cpp.cpp list.cpp ring_buffer.cpp StringHash.cpp ]
147			= [ FDirName $(HAIKU_TOP) src system kernel util ] ;
148
149		SEARCH on [ FGristFiles KMessage.cpp ]
150			= [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;
151
152		SEARCH on [ FGristFiles safemode_settings.cpp ]
153			= [ FDirName $(HAIKU_TOP) src system kernel debug ] ;
154
155		SEARCH on [ FGristFiles driver_settings.cpp ]
156			= [ FDirName $(HAIKU_TOP) src system libroot os ] ;
157
158		SEARCH on [ FGristFiles amiga_rdb.cpp ]
159			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems amiga ] ;
160
161		SEARCH on [ FGristFiles apple.cpp ]
162			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems apple ] ;
163
164		SEARCH on [ FGristFiles gpt.cpp Header.cpp crc32.cpp utility.cpp ]
165			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems gpt ] ;
166
167		SEARCH on [ FGristFiles intel.cpp PartitionMap.cpp PartitionMapParser.cpp ]
168			= [ FDirName $(HAIKU_TOP) src add-ons kernel partitioning_systems intel ] ;
169
170		SEARCH on [ FGristFiles stage2_crt0.S ]
171			= [ FDirName $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ] ;
172
173		SEARCH on [ FGristFiles DataIO.cpp Referenceable.cpp ]
174			= [ FDirName $(HAIKU_TOP) src kits support ] ;
175	}
176}
177
178SubInclude HAIKU_TOP src system boot loader file_systems ;
179SubInclude HAIKU_TOP src system boot loader net ;
180