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