xref: /haiku/src/system/Jamfile (revision fef6144999c2fa611f59ee6ffe6dd7999501385c)
1SubDir OBOS_TOP src system ;
2
3KernelLd boot_loader :
4	boot_platform_$(OBOS_BOOT_PLATFORM).o
5	boot_loader.a
6	boot_partitions.a
7
8	# file systems
9	boot_bfs.a
10	boot_amiga_ffs.a
11
12	# libroot functions needed by the stage2 boot loader
13	<$(SOURCE_GRIST)!libroot!os!arch!$(OBOS_ARCH)>byteorder.o
14	<$(SOURCE_GRIST)!libroot>ctype.o
15	<$(SOURCE_GRIST)!libroot>kernel_vsprintf.o
16	<$(SOURCE_GRIST)!libroot!posix!string>memset.o
17	<$(SOURCE_GRIST)!libroot!posix!string>memcmp.o
18	<$(SOURCE_GRIST)!libroot!posix!string>memcpy.o
19	<$(SOURCE_GRIST)!libroot!posix!string>memmove.o
20	<$(SOURCE_GRIST)!libroot!posix!string>strdup.o
21	<$(SOURCE_GRIST)!libroot!posix!string>strlen.o
22	<$(SOURCE_GRIST)!libroot!posix!string>strnlen.o
23	<$(SOURCE_GRIST)!libroot!posix!string>strcmp.o
24	<$(SOURCE_GRIST)!libroot!posix!string>strcasecmp.o
25	<$(SOURCE_GRIST)!libroot!posix!string>strncmp.o
26	<$(SOURCE_GRIST)!libroot!posix!string>strcat.o
27	<$(SOURCE_GRIST)!libroot!posix!string>strcpy.o
28	<$(SOURCE_GRIST)!libroot!posix!string>strlcat.o
29	<$(SOURCE_GRIST)!libroot!posix!string>strlcpy.o
30	<$(SOURCE_GRIST)!libroot!posix!string>strchr.o
31	<$(SOURCE_GRIST)!libroot!posix!string>strrchr.o
32	<$(SOURCE_GRIST)!libroot!posix!stdlib>strtol.o
33	<$(SOURCE_GRIST)!libroot>qsort.o
34	: $(SUBDIR)/ldscripts/$(OBOS_ARCH)/boot_loader.ld
35	: -Bstatic
36	;
37
38KernelLd stage2 :
39	boot_arch_stage2.o
40
41	# posix functions needed by the stage2 boot loader
42	<$(SOURCE_GRIST)!libroot>ctype.o
43	<$(SOURCE_GRIST)!libroot>kernel_vsprintf.o
44	<$(SOURCE_GRIST)!libroot!posix!string>memset.o
45	<$(SOURCE_GRIST)!libroot!posix!string>memcpy.o
46	<$(SOURCE_GRIST)!libroot!posix!string>strnlen.o
47	: $(SUBDIR)/ldscripts/$(OBOS_ARCH)/stage2.ld
48	: -dN
49	:
50	: bootstrap
51	;
52
53KernelLd kernel_$(OBOS_ARCH) :
54	kernel_core.o
55	kernel_fs.o
56	kernel_vm.o
57	kernel_cache.o
58	kernel_device_manager.o
59	kernel_disk_device_manager.o
60	kernel_util.o
61	kernel_messaging.o
62	kernel_debug.o
63
64	lib$(OBOS_ARCH).a
65
66	linkhack.so
67
68	# kernel libroot parts
69	kernel_os_main.o
70	kernel_os_arch_$(OBOS_ARCH).o
71	kernel_posix.o
72
73	: $(SUBDIR)/ldscripts/$(OBOS_ARCH)/kernel.ld
74	: -Bdynamic -export-dynamic -dynamic-linker /foo/bar
75	:
76	: kernel
77	;
78LINKLIBS on kernel_$(OBOS_ARCH) += $(KERNEL_C++_SUPPORT_LIBS) ;
79
80KernelLd kernel.so :
81	kernel_core.o
82	kernel_fs.o
83	kernel_vm.o
84	kernel_cache.o
85	kernel_device_manager.o
86	kernel_disk_device_manager.o
87	kernel_util.o
88	kernel_messaging.o
89	kernel_debug.o
90
91	lib$(OBOS_ARCH).a
92
93	linkhack.so
94
95	# kernel libroot parts
96	kernel_os_main.o
97	kernel_os_arch_$(OBOS_ARCH).o
98	kernel_posix.o
99
100	: $(SUBDIR)/ldscripts/$(OBOS_ARCH)/kernel.ld
101	: -Bdynamic -shared -export-dynamic -dynamic-linker /foo/bar
102	;
103LINKLIBS on kernel.so += $(KERNEL_C++_SUPPORT_LIBS) ;
104
105# ToDo: this is outdated; instead, the standard Be mechanism should be used
106KernelLd libglue.o :	# libglue.o is used for dynamic libraries
107	<$(SOURCE_GRIST)!glue!arch!$(OBOS_ARCH)>crti.o
108	$(LIBGCC_DIR)/crtbegin.o
109
110	$(LIBGCC_DIR)/crtend.o
111	<$(SOURCE_GRIST)!glue!arch!$(OBOS_ARCH)>crtn.o
112
113	<$(SOURCE_GRIST)!glue>init_term_dyn.o
114	:
115	: -r
116	: no_gcc
117	;
118
119UnarchiveObjects $(LIBGCC_OBJECTS) : $(LIBGCC_DIR)/libgcc.a ;
120	# we need to link against libgcc.a objects and make
121	# it available to other applications as in BeOS
122
123# ToDo: Rewrite as SharedLibrary
124KernelLd libroot.so :
125	<$(SOURCE_GRIST)!glue!arch!$(OBOS_ARCH)>crti.o
126	$(LIBGCC_DIR)/crtbegin.o
127
128	<$(SOURCE_GRIST)!glue>init_term_dyn.o
129
130	$(LIBGCC_OBJECTS)
131	<$(SOURCE_GRIST)!libroot>libroot_init.o
132
133	os_main.o
134	os_arch_$(OBOS_ARCH).o
135
136	posix_arch_$(OBOS_ARCH).o
137	posix_crypt.o
138	posix_locale.o
139	posix_main.o
140	posix_malloc.o
141	posix_math.o
142	posix_math_arch_$(OBOS_ARCH).o
143	posix_pthread.o
144	posix_signal.o
145	posix_stdio.o
146	posix_gnu_arch_$(OBOS_ARCH).o
147	posix_gnu_ctype.o
148	posix_gnu_ext.o
149	posix_gnu_libio.o
150	posix_gnu_locale.o
151	posix_gnu_regex.o
152	posix_gnu_stdio.o
153	posix_gnu_stdlib.o
154	posix_gnu_wcsmbs.o
155	posix_stdlib.o
156	posix_string.o
157	posix_sys.o
158	posix_time.o
159	posix_unistd.o
160
161	$(LIBGCC_DIR)/crtend.o
162	<$(SOURCE_GRIST)!glue!arch!$(OBOS_ARCH)>crtn.o
163
164	: $(SUBDIR)/ldscripts/$(OBOS_ARCH)/library.ld
165	: -shared -soname libroot.so -Bdynamic -export-dynamic
166	: no_gcc
167	: beos/system/lib/libroot.so
168	;
169
170KernelLd libglue2.o :	# libglue2.o is used for executables
171	libglue.o
172	<$(SOURCE_GRIST)!glue>start_dyn.o
173	:
174	: -r
175	: no_gcc
176	;
177
178
179WriteKernelConfig $(OBOS_KERNEL_CONFIG) ;
180BuildKernel $(OBOS_KERNEL) : $(OBOS_KERNEL_CONFIG) ;
181
182NotFile kernel ;
183Depends kernel : kernel_$(OBOS_ARCH) ;
184Depends kernel.so : kernel ;
185	# kernel.so will be rebuilt with the kernel
186
187SubInclude OBOS_TOP src system boot ;
188SubInclude OBOS_TOP src system kernel ;
189SubInclude OBOS_TOP src system glue ;
190SubInclude OBOS_TOP src system libroot ;
191SubInclude OBOS_TOP src system runtime_loader ;
192