xref: /haiku/src/system/boot/Jamfile (revision 5e96d7d537fbec23bad4ae9b4c8e7b02e769f0c6)
1SubDir HAIKU_TOP src system boot ;
2
3DEFINES += _BOOT_MODE ;
4
5SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot os arch
6					$(TARGET_KERNEL_ARCH) ] ;
7SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix string ] ;
8SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix stdlib ] ;
9SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix locale ] ;
10SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) kernel lib ] ;
11
12UsePrivateHeaders [ FDirName libroot locale ] ;
13
14BootMergeObject boot_libroot.o :
15	abs.c
16	atomic.S
17	ctype.cpp
18	LocaleData.cpp
19	qsort.c
20	kernel_vsprintf.cpp
21	memchr.c
22	memcmp.c
23	memmove.c
24	strdup.c
25	strndup.cpp
26	strlen.cpp
27	strnlen.cpp
28	strcmp.c
29	strcasecmp.c
30	strncmp.c
31	strcat.c
32	strcpy.c
33	strerror.c
34	strlcat.c
35	strlcpy.c
36	strchr.c
37	strrchr.c
38	strtol.c
39	: -fno-pic
40;
41
42local extraLinkerArgs = ;
43if $(HAIKU_BOARD_LOADER_BASE) {
44	extraLinkerArgs += --defsym BOARD_LOADER_BASE=$(HAIKU_BOARD_LOADER_BASE) ;
45}
46
47AddResources haiku_loader : boot_loader.rdef ;
48
49BootLd boot_loader_$(TARGET_BOOT_PLATFORM) :
50	boot_platform_$(TARGET_BOOT_PLATFORM).o
51	boot_arch_$(TARGET_KERNEL_ARCH).o
52	boot_loader.a
53	boot_net.a
54	boot_partitions.a
55
56	# file systems
57	boot_bfs.a
58	boot_amiga_ffs.a
59	boot_tarfs.a
60	boot_fatfs.a
61	boot_packagefs.a
62
63	boot_loader.a
64		# a second time, so undefined references in the file systems can be
65		# resolved
66
67	# needed by tarfs, packagefs, and video_splash.cpp
68	boot_zlib.a
69
70	# libroot functions needed by the stage2 boot loader
71	boot_libroot.o
72
73	: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(TARGET_BOOT_PLATFORM).ld
74	: -Bstatic $(extraLinkerArgs)
75;
76
77rule BuildCoffLoader {
78	local coffLoader = $(1) ;
79	local bootLoader = $(2) ;
80	# XXX: eventually switch on arch
81	COFF_FORMAT on $(coffLoader) = xcoff-powermac ;
82	HACK_COFF on $(coffLoader) = <build>hack-coff ;
83
84	Depends $(coffLoader) : <build>hack-coff ;
85	Depends $(coffLoader) : $(bootLoader) ;
86	MakeLocateDebug $(coffLoader) ;
87}
88
89actions BuildCoffLoader bind HACK_COFF {
90	rm -f $(1)
91	$(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -O $(COFF_FORMAT) $(2) $(1)
92	#$(CP) $(2) $(1)
93	$(HACK_COFF) $(1)
94}
95
96BuildCoffLoader boot_loader_$(TARGET_BOOT_PLATFORM)_coff : boot_loader_$(TARGET_BOOT_PLATFORM) ;
97
98rule BuildBiosLoader {
99	local haikuLoader = $(1) ;
100	local bootLoader = $(2) ;
101
102	Depends $(haikuLoader) : $(bootLoader) ;
103	MakeLocateDebug $(haikuLoader) ;
104
105	on $(1) ResAttr $(1) : $(RESFILES) : false ;
106	if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
107		SetType $(1) ;
108		MimeSet $(1) ;
109	}
110}
111
112actions BuildBiosLoader {
113	rm -f $(1)
114	$(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -O binary $(2) $(1)
115}
116
117BuildBiosLoader haiku_loader : boot_loader_$(TARGET_BOOT_PLATFORM) ;
118
119# different target for PXE, to be build with TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku-loader
120BuildBiosLoader pxehaiku-loader : boot_loader_$(TARGET_BOOT_PLATFORM) ;
121
122SubInclude HAIKU_TOP src system boot arch $(TARGET_KERNEL_ARCH) ;
123SubInclude HAIKU_TOP src system boot loader ;
124SubInclude HAIKU_TOP src system boot platform ;
125