xref: /haiku/src/system/kernel/Jamfile (revision e6b30aee0fd7a23d6a6baab9f3718945a0cd838a)
1SubDir HAIKU_TOP src system kernel ;
2
3{
4	local defines =
5		HAIKU_ARCH=\\\"$(TARGET_ARCH)\\\"
6		;
7
8	defines = [ FDefines $(defines) ] ;
9	SubDirCcFlags $(defines) ;
10	SubDirC++Flags $(defines) ;
11}
12
13UsePrivateHeaders shared ;
14UsePrivateHeaders runtime_loader ;
15
16AddResources kernel_$(TARGET_ARCH) : kernel.rdef ;
17
18KernelMergeObject kernel_core.o :
19	boot_item.cpp
20	commpage.cpp
21	condition_variable.cpp
22	cpu.c
23	elf.cpp
24	heap.c
25	image.c
26	int.c
27	kernel_daemon.c
28	linkhack.c
29	lock.c
30	main.c
31	module.cpp
32	Notifications.cpp
33	port.cpp
34	real_time_clock.c
35	scheduler.cpp
36	sem.cpp
37	shutdown.c
38	signal.cpp
39	system_info.c
40	smp.c
41	syscalls.cpp
42	team.cpp
43	thread.cpp
44	timer.c
45	wait_for_objects.cpp
46
47	: $(TARGET_KERNEL_PIC_CCFLAGS)
48;
49
50# We need to specify the dependency on the generated syscalls files explicitly.
51Includes [ FGristFiles syscalls.cpp ]
52	: <syscalls>syscall_dispatcher.h <syscalls>syscall_table.h
53	  <syscalls>syscall_numbers.h
54;
55
56KernelLd linkhack.so :
57	<$(SOURCE_GRIST)>linkhack.o
58	:
59	:
60	-shared -Bdynamic
61;
62
63KernelLd kernel_$(TARGET_ARCH) :
64	kernel_core.o
65	kernel_fs.o
66	kernel_vm.o
67	kernel_cache.o
68	kernel_device_manager.o
69	kernel_disk_device_manager.o
70	kernel_util.o
71	kernel_messaging.o
72	kernel_debug.o
73	kernel_slab.o
74
75	lib$(TARGET_ARCH).a
76	kernel_platform_$(TARGET_BOOT_PLATFORM).o
77
78	linkhack.so
79
80	# kernel parts borrowed from libroot and others
81	kernel_os_main.o
82	kernel_os_arch_$(TARGET_ARCH).o
83	kernel_posix.o
84	kernel_posix_arch_$(TARGET_ARCH).o
85	kernel_misc.o
86
87	$(HAIKU_STATIC_LIBSUPC++)
88
89	: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/kernel.ld
90	: -Bdynamic -export-dynamic -dynamic-linker /foo/bar
91	  $(TARGET_KERNEL_PIC_LINKFLAGS)
92	:
93;
94
95KernelLd kernel.so :
96	kernel_core.o
97	kernel_fs.o
98	kernel_vm.o
99	kernel_cache.o
100	kernel_device_manager.o
101	kernel_disk_device_manager.o
102	kernel_util.o
103	kernel_messaging.o
104	kernel_debug.o
105	kernel_slab.o
106
107	lib$(TARGET_ARCH).a
108	kernel_platform_$(TARGET_BOOT_PLATFORM).o
109
110	linkhack.so
111
112	# kernel libroot parts
113	kernel_os_main.o
114	kernel_os_arch_$(TARGET_ARCH).o
115	kernel_posix.o
116	kernel_posix_arch_$(TARGET_ARCH).o
117
118	$(HAIKU_STATIC_LIBSUPC++)
119
120	: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/kernel.ld
121	: -Bdynamic -shared -export-dynamic -dynamic-linker /foo/bar
122	  $(TARGET_KERNEL_PIC_LINKFLAGS)
123;
124
125NotFile kernel ;
126Depends kernel : kernel_$(TARGET_ARCH) ;
127Depends kernel.so : kernel ;
128	# kernel.so will be rebuilt with the kernel
129
130# propagate HAIKU_INCLUDE_IN_IMAGE variable from kernel to kernel_$(TARGET_ARCH)
131HAIKU_INCLUDE_IN_IMAGE on kernel_$(TARGET_ARCH)
132		= [ on kernel return $(HAIKU_INCLUDE_IN_IMAGE) ] ;
133
134# Copy kernel and update the copy's revision section. We link everything
135# against the original, but the copy will end up on the disk image (this way
136# we avoid unnecessary dependencies). The copy will be located in a subdirectory.
137if $(TARGET_PLATFORM) = haiku {
138	MakeLocate <revisioned>kernel_$(TARGET_ARCH)
139		: [ FDirName $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) revisioned ] ;
140	CopySetHaikuRevision <revisioned>kernel_$(TARGET_ARCH)
141		: kernel_$(TARGET_ARCH) ;
142}
143
144
145SubInclude HAIKU_TOP src system kernel arch ;
146SubInclude HAIKU_TOP src system kernel cache ;
147SubInclude HAIKU_TOP src system kernel device_manager ;
148SubInclude HAIKU_TOP src system kernel debug ;
149SubInclude HAIKU_TOP src system kernel disk_device_manager ;
150SubInclude HAIKU_TOP src system kernel fs ;
151SubInclude HAIKU_TOP src system kernel lib ;
152SubInclude HAIKU_TOP src system kernel messaging ;
153SubInclude HAIKU_TOP src system kernel slab ;
154SubInclude HAIKU_TOP src system kernel util ;
155SubInclude HAIKU_TOP src system kernel vm ;
156
157if $(TARGET_BOOT_PLATFORM) {
158	SubInclude HAIKU_TOP src system kernel platform $(TARGET_BOOT_PLATFORM) ;
159}
160