xref: /haiku/src/system/boot/Jamfile (revision 82a8a20999118b748396cf16a33c47c3b0c0222d)
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
25AddResources haiku_loader : boot_loader.rdef ;
26
27KernelLd boot_loader_$(TARGET_BOOT_PLATFORM) :
28	boot_platform_$(TARGET_BOOT_PLATFORM).o
29	boot_arch_$(TARGET_ARCH).o
30	boot_loader.a
31	boot_net.a
32	boot_partitions.a
33
34	# file systems
35	boot_bfs.a
36	boot_amiga_ffs.a
37	boot_tarfs.a
38	boot_fatfs.a
39
40	# needed by tarfs
41	boot_zlib.a
42
43	# libroot functions needed by the stage2 boot loader (compiled for the
44	# kernel)
45	$(librootFunctions:G=src!system!kernel!lib)
46
47	: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(TARGET_BOOT_PLATFORM).ld
48	: -Bstatic
49;
50
51rule BuildCoffLoader {
52	local coffLoader = $(1) ;
53	local bootLoader = $(2) ;
54	# XXX: eventually switch on arch
55	COFF_FORMAT on $(coffLoader) = xcoff-powermac ;
56	HACK_COFF on $(coffLoader) = <build>hack-coff ;
57
58	Depends $(coffLoader) : <build>hack-coff ;
59	Depends $(coffLoader) : $(bootLoader) ;
60	MakeLocateDebug $(coffLoader) ;
61}
62
63actions BuildCoffLoader bind HACK_COFF {
64	rm -f $(1)
65	$(TARGET_OBJCOPY) -O $(COFF_FORMAT) $(2) $(1)
66	#$(CP) $(2) $(1)
67	$(HACK_COFF) $(1)
68}
69
70BuildCoffLoader boot_loader_$(TARGET_BOOT_PLATFORM)_coff : boot_loader_$(TARGET_BOOT_PLATFORM) ;
71
72rule BuildBiosLoader {
73	local haikuLoader = $(1) ;
74	local bootLoader = $(2) ;
75
76	Depends $(haikuLoader) : $(bootLoader) ;
77	MakeLocateDebug $(haikuLoader) ;
78
79	on $(1) ResAttr $(1) : $(RESFILES) : false ;
80	if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
81		SetType $(1) ;
82		MimeSet $(1) ;
83	}
84}
85
86actions BuildBiosLoader {
87	rm -f $(1)
88	$(TARGET_OBJCOPY) -O binary $(2) $(1)
89}
90
91BuildBiosLoader haiku_loader : boot_loader_$(TARGET_BOOT_PLATFORM) ;
92
93# different target for PXE, to be build with TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku-loader
94BuildBiosLoader pxehaiku-loader : boot_loader_$(TARGET_BOOT_PLATFORM) ;
95
96SubInclude HAIKU_TOP src system boot arch $(TARGET_ARCH) ;
97SubInclude HAIKU_TOP src system boot loader ;
98SubInclude HAIKU_TOP src system boot platform ;
99