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