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