1SubDir HAIKU_TOP src tools makebootable platform bios_ia32 ;
2
3SubDirHdrs $(HAIKU_TOP) src add-ons kernel file_systems bfs ;
4
5UsePrivateHeaders storage shared ;
6UsePrivateSystemHeaders ;
7
8SEARCH_SOURCE
9	+= [ FDirName $(HAIKU_TOP) src bin makebootable platform bios_ia32 ] ;
10
11USES_BE_API on <build>makebootable = true ;
12
13local hostPlatformSources ;
14if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd || $(HOST_PLATFORM) = darwin {
15	UsePrivateHeaders interface ;
16
17	hostPlatformSources = PartitionMap.cpp PartitionMapParser.cpp
18		PartitionMapWriter.cpp crc32.cpp Header.cpp utility.cpp ;
19
20	SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel
21		partitioning_systems intel ] ;
22	SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel
23		partitioning_systems gpt ] ;
24	SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel
25		partitioning_systems common ] ;
26
27	DEFINES += _USER_MODE ;
28}
29
30# Write the stage 1 boot loader into the makebootable resources. On Darwin
31# resources don't seem to work; there we use an attribute instead.
32if $(HOST_PLATFORM) != darwin && $(HOST_PLATFORM) != mingw {
33	AddFileDataResource <build>makebootable : RAWT:666:BootCode : stage1.bin ;
34}
35
36BuildPlatformMain <build>makebootable :
37	makebootable.cpp
38	$(hostPlatformSources)
39	: $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
40;
41
42# on Darwin write the boot loader code into an attribute
43if $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = mingw {
44	AddFileDataAttribute <build>makebootable : BootCode : raw : stage1.bin ;
45}
46