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