xref: /haiku/src/system/boot/Jamfile (revision 0d452c8f34013b611a54c746a71c05e28796eae2)
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	strndup.o
13	strlen.o
14	strnlen.o
15	strcmp.o
16	strcasecmp.o
17	strncmp.o
18	strcat.o
19	strcpy.o
20	strerror.o
21	strlcat.o
22	strlcpy.o
23	strchr.o
24	strrchr.o
25	strtol.o
26;
27
28local librootArchFunctions =
29	atomic.o
30;
31
32local extraLinkerArgs = ;
33if $(HAIKU_BOARD_LOADER_BASE) {
34	extraLinkerArgs += --defsym BOARD_LOADER_BASE=$(HAIKU_BOARD_LOADER_BASE) ;
35}
36
37AddResources haiku_loader : boot_loader.rdef ;
38
39# don't link against libsupc++
40HAIKU_NO_LIBSUPC++ on boot_loader_$(TARGET_BOOT_PLATFORM) = true ;
41
42KernelLd boot_loader_$(TARGET_BOOT_PLATFORM) :
43	boot_platform_$(TARGET_BOOT_PLATFORM).o
44	boot_arch_$(TARGET_ARCH).o
45	boot_loader.a
46	boot_net.a
47	boot_partitions.a
48
49	# file systems
50	boot_bfs.a
51	boot_amiga_ffs.a
52	boot_tarfs.a
53	boot_fatfs.a
54	boot_packagefs.a
55
56	boot_loader.a
57		# a second time, so undefined references in the file systems can be
58		# resolved
59
60	# needed by tarfs, packagefs, and video_splash.cpp
61	boot_zlib.a
62
63	# libroot functions needed by the stage2 boot loader (compiled for the
64	# kernel)
65	$(librootFunctions:G=src!system!kernel!lib)
66	$(librootArchFunctions:G=src!system!kernel!lib!arch!$(TARGET_ARCH))
67
68	: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(TARGET_BOOT_PLATFORM).ld
69	: -Bstatic $(extraLinkerArgs)
70;
71
72rule BuildCoffLoader {
73	local coffLoader = $(1) ;
74	local bootLoader = $(2) ;
75	# XXX: eventually switch on arch
76	COFF_FORMAT on $(coffLoader) = xcoff-powermac ;
77	HACK_COFF on $(coffLoader) = <build>hack-coff ;
78
79	Depends $(coffLoader) : <build>hack-coff ;
80	Depends $(coffLoader) : $(bootLoader) ;
81	MakeLocateDebug $(coffLoader) ;
82}
83
84actions BuildCoffLoader bind HACK_COFF {
85	rm -f $(1)
86	$(TARGET_OBJCOPY) -O $(COFF_FORMAT) $(2) $(1)
87	#$(CP) $(2) $(1)
88	$(HACK_COFF) $(1)
89}
90
91BuildCoffLoader boot_loader_$(TARGET_BOOT_PLATFORM)_coff : boot_loader_$(TARGET_BOOT_PLATFORM) ;
92
93rule BuildBiosLoader {
94	local haikuLoader = $(1) ;
95	local bootLoader = $(2) ;
96
97	Depends $(haikuLoader) : $(bootLoader) ;
98	MakeLocateDebug $(haikuLoader) ;
99
100	on $(1) ResAttr $(1) : $(RESFILES) : false ;
101	if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
102		SetType $(1) ;
103		MimeSet $(1) ;
104	}
105}
106
107actions BuildBiosLoader {
108	rm -f $(1)
109	$(TARGET_OBJCOPY) -O binary $(2) $(1)
110}
111
112BuildBiosLoader haiku_loader : boot_loader_$(TARGET_BOOT_PLATFORM) ;
113
114# different target for PXE, to be build with TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku-loader
115BuildBiosLoader pxehaiku-loader : boot_loader_$(TARGET_BOOT_PLATFORM) ;
116
117SubInclude HAIKU_TOP src system boot arch $(TARGET_ARCH) ;
118SubInclude HAIKU_TOP src system boot loader ;
119SubInclude HAIKU_TOP src system boot platform ;
120