3 SUBSYSTEMS = JABI ABI DRIVERS KERNEL LIBK CXXLIB JDB \
4 TCBOFFSET SYMBOLS VERSION GBLCFG MINILIBC
6 ifeq ("$(CONFIG_GSTABS)","y")
10 PREPROCESS_PARTS += arch $(CONFIG_ABI) 32bit $(CONFIG_XARCH) \
11 fpu jdb_thread_names iofp \
12 obj_space_phys abs_syscalls auto_map_kip \
15 PREPROCESS_PARTS-$(CONFIG_MP) += mp
16 PREPROCESS_PARTS-$(CONFIG_LIST_ALLOC_SANITY) += list_alloc_debug
17 PREPROCESS_PARTS-$(CONFIG_JDB) += debug log
18 PREPROCESS_PARTS-$(CONFIG_PERF_CNT) += perf_cnt
19 PREPROCESS_PARTS-$(CONFIG_CONTEXT_4K) += context_4k
20 PREPROCESS_PARTS-$(CONFIG_SCHED_FIXED_PRIO) += sched_fixed_prio
21 PREPROCESS_PARTS-$(CONFIG_SCHED_WFQ) += sched_wfq
22 PREPROCESS_PARTS-$(CONFIG_SCHED_FP_WFQ) += sched_fp_wfq
24 PREPROCESS_PARTS += $(PREPROCESS_PARTS-y)
29 PRIVATE_INCDIR += types/$(CONFIG_XARCH) types
36 INTERFACES_ABI := l4_fpage l4_msg_item l4_buf_desc kip l4_types \
39 kip_IMPL := kip kip-ia32 kip-debug kip-ia32-debug
40 l4_types_IMPL := l4_types l4_types-debug
46 VPATH += jabi/$(CONFIG_XARCH) jabi
47 INTERFACES_JABI := jdb_ktrace
52 DRIVERS := libdrivers.a
53 VPATH += drivers/ux drivers/ia32 drivers
54 PRIVATE_INCDIR += drivers/ux drivers/ia32 drivers
55 INTERFACES_DRIVERS := mux_console console filter_console processor \
58 processor_IMPL := processor processor-ux
59 mem_IMPL := mem mem-ia32
64 KERNEL := fiasco.image
66 VPATH += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
67 VPATH += jdb/ia32 jdb/ia32/32 jdb/ux jdb
68 PRIVATE_INCDIR += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
70 KERNEL_EXTRA-$(CONFIG_UX_CON) += ux_con
71 KERNEL_EXTRA-$(CONFIG_UX_NET) += ux_net
72 KERNEL_EXTRA += $(KERNEL_EXTRA-y)
76 # Important: The following list must be roughly sorted according to
77 # link dependencies. The Unit test for a module M links against all
78 # modules that precede M in this list, minus sibling modules (those
79 # modules that _directly_ precede M and that M does not include).
81 INTERFACES_KERNEL := mem_region simpleio kernel_console panic warn \
82 bitmap buddy_alloc koptions context_base \
83 mem_layout per_cpu_data globals loader vhw \
84 kip_init ipi queue_item queue cpu_mask rcupdate \
85 boot_info config jdb_symbol jdb_util \
86 tb_entry perf_cnt jdb_tbuf x86desc \
87 emulation pic usermode cpu trampoline cpu_lock \
88 spin_lock boot_alloc \
89 entry_frame continuation \
91 ram_quota kmem_alloc ptab_base per_cpu_data_alloc \
93 slab_cache kmem_slab dbg_page_info \
94 vmem_alloc paging fpu_state fpu \
95 ready_queue_wfq ready_queue_fp \
96 sched_context switch_lock timer timeout \
97 obj_space kobject_dbg kobject kobject_iface \
99 mem_space space vcpu context \
101 mp_lock ipc_gate irq_controller \
102 mapping mapping_tree mappable \
103 mapdb kobject_mapdb map_util \
104 hostproc task sigma0_task kernel_task prio_list \
105 thread_lock timeslice_timeout \
106 ipc_timeout thread_state \
107 sender receiver ipc_sender thread thread_object \
108 kobject_helper timer_tick platform_control \
110 kernel_thread dirq irq_chip irq_mgr \
111 irq_chip_ia32 irq_chip_pic \
112 banner fpu_alloc irq icu_helper main \
113 startup libc_support \
114 jdb_dbinfo jdb fb net utcb_init \
115 jdb_core jdb_module jdb_table \
116 jdb_thread_list jdb_input jdb_dump jdb_thread \
117 jdb_lines jdb_tcb jdb_prompt_module jdb_bt \
118 jdb_mapdb jdb_ptab jdb_kern_info jdb_counters \
119 glibc_getchar jdb_trace jdb_trace_set \
120 jdb_tbuf_init kern_cnt \
121 jdb_tbuf_output jdb_tbuf_show \
122 jdb_misc checksum watchdog terminate \
123 jdb_screen push_console jdb_bp \
124 jdb_attach_irq sys_call_page \
125 jdb_timeout gdt factory \
126 idt tss trap_state jdb_prompt_ext \
127 jdb_handler_queue jdb_exit_module \
128 jdb_halt_thread jdb_tetris \
130 jdb_kern_info_kmem_alloc jdb_kern_info_config \
131 jdb_space jdb_trap_state \
133 jdb_entry_frame kdb_ke jdb_ipi app_cpu_thread \
134 jdb_rcupdate jdb_kobject jdb_kobject_names \
135 jdb_list jdb_ipc_gate jdb_obj_space \
136 jdb_log jdb_factory scheduler \
137 platform_control_object \
138 jdb_scheduler clock jdb_sender_list \
141 boot_info_IMPL := boot_info boot_info-ia32 boot_info-ux
142 clock_IMPL := clock clock-ia32
143 config_IMPL := config config-ia32-32 config-ux
144 context_IMPL := context context-ia32 context-ia32-32 context-ux \
146 continuation_IMPL := continuation-ia32-32-ux
147 cpu_IMPL := cpu cpu-ia32 cpu-ux cpu-32
148 cpu_lock_IMPL := cpu_lock cpu_lock-generic
149 dirq_IMPL := dirq-ia32-ux
150 dirq_pic_pin_IMPL := dirq_pic_pin dirq_pic_pin-ia32-ux
151 entry_frame_IMPL := entry_frame entry_frame-ia32-ux \
152 entry_frame-abs-timeout-hack
153 fpu_IMPL := fpu fpu-ia32-ux fpu-ux
154 irq_IMPL := irq irq-ux
155 ipi_IMPL := ipi ipi-ux
156 jdb_IMPL := jdb jdb-ux jdb-ansi jdb-ia32-ux jdb-thread \
157 jdb-int3 jdb-int3-ia32-ux
158 jdb_tcb_IMPL := jdb_tcb jdb_tcb-ia32-ux
159 jdb_bp_IMPL := jdb_bp-ia32-ux jdb_bp-ux
160 jdb_bt_IMPL := jdb_bt-ia32-ux
161 jdb_entry_frame_IMPL := jdb_entry_frame-ia32
162 jdb_kern_info_IMPL := jdb_kern_info jdb_kern_info-ux \
163 jdb_kern_info-ia32-ux jdb_kern_info-ia32-amd64
164 jdb_misc_IMPL := jdb_misc-ia32-amd64
165 jdb_ptab_IMPL := jdb_ptab jdb_ptab-ia32-ux-arm
166 jdb_screen_IMPL := jdb_screen jdb_screen-ia32
167 jdb_trace_set_IMPL := jdb_trace_set jdb_trace_set-ia32-ux
168 kdb_ke_IMPL := kdb_ke kdb_ke-ia32
169 kernel_thread_IMPL := kernel_thread kernel_thread-std kernel_thread-ux
170 kip_init_IMPL := kip_init-ia32 kip_init-ux
171 kmem_IMPL := kmem-ia32 kmem-ux
172 kmem_alloc_IMPL := kmem_alloc kmem_alloc-ia32
173 main_IMPL := main-ia32-32 main-ux
174 mapping_IMPL := mapping-ia32-32 mapping
175 map_util_IMPL := map_util map_util-mem map_util-objs
176 mem_layout_IMPL := mem_layout mem_layout-ia32 mem_layout-ux
177 mem_space_IMPL := mem_space mem_space-user mem_space-ia32 \
179 mem_unit_IMPL := mem_unit-ux
180 obj_space_IMPL := obj_space obj_space-phys
181 paging_IMPL := paging-ia32-32 paging-ia32 paging
182 perf_cnt_IMPL := perf_cnt perf_cnt-ia32
183 pic_IMPL := pic pic-ux
184 pmem_alloc_IMPL := pmem_alloc pmem_alloc-ia32-ux
185 sched_context_IMPL := sched_context-wfq sched_context-fixed_prio \
186 sched_context-fp_wfq sched_context
187 space_IMPL := space space-ux
188 syscalls_IMPL := syscalls syscalls-log
189 sys_call_page_IMPL := sys_call_page sys_call_page-abs-ux
190 task_IMPL := task task-ux
191 tb_entry_IMPL := tb_entry tb_entry-ia32-32
192 terminate_IMPL := terminate-ux
193 thread_IMPL := thread thread-ia32 thread-ia32-32 thread-ux \
194 thread-ipc thread-pagefault thread-log \
195 thread-debug thread-io thread-vcpu
196 timer_IMPL := timer timer-ia32-amd64-ux timer-ux
197 timer_tick_IMPL := timer_tick timer_tick-single-vector timer_tick-ia32
198 utcb_init_IMPL := utcb_init utcb_init-ux
199 vmem_alloc_IMPL := vmem_alloc vmem_alloc-ia32 vmem_alloc-ux
200 spin_lock_IMPL := spin_lock spin_lock-ia32
202 CXXSRC_KERNEL := libc_backend_nolock.cc glue_libc_ux.cc tb_entry_output.cc
203 ASSRC_KERNEL := entry-ux.S entry.S sighandler.S \
206 ifeq ($(CONFIG_MP),y)
207 ASSRC_KERNEL += tramp-mp.S entry-mp.S
211 NOOPT += $(filter jdb%,\
212 $(foreach in,$(INTERFACES_KERNEL), \
213 $(if $($(in)_IMPL),$($(in)_IMPL),$(in))))
214 NOOPT += tb_entry tb_entry_output
217 # TCBOFFSET subsystem
219 TCBOFFSET := tcboffset.h
220 CXXSRC_TCBOFFSET := tcboffset.cc dump_tcboffsets.cc
231 PROG_LINES := genlines
242 OBJ_KERNEL += gblcfg.o
249 INTERFACES_CXXLIB := s_cruft paranoia
255 VPATH += lib/libk/$(CONFIG_XARCH) lib/libk
256 PRIVATE_INCDIR += lib/libk/$(CONFIG_XARCH) lib/libk
257 INTERFACES_LIBK := atomic lock_guard auto_ptr std_macros
258 CXXSRC_LIBK += construction.cc
261 ifneq ($(CONFIG_JDB_GZIP),)
262 ifneq ($(wildcard $(srcdir)/lib/gzip),)
263 SUBSYSTEMS += LIBGZIP
264 KERNEL_EXTRA_LIBS += $(LIBGZIP)
265 INTERFACES_KERNEL += jdb_gzip
269 PRIVATE_INCDIR += lib/gzip
270 CSRC_LIBGZIP := adler32.c crc32.c gzip.c trees.c deflate.c zutil.c
271 NOOPT += $(patsubst %.o, %, $(OBJ_LIBGZIP))
276 # LIBDISASM subsystem (only for Jdb)
278 ifeq ("$(CONFIG_JDB_DISASM)","y")
279 # $(srcdir)/lib/disasm may be removed
280 ifeq ($(wildcard $(srcdir)/lib/disasm),)
281 $(error $(srcdir)/lib/disasm is missing, disable CONFIG_JDB_DISASM)
284 SUBSYSTEMS += LIBDISASM
285 KERNEL_EXTRA_LIBS += $(LIBDISASM)
286 PREPROCESS_PARTS += jdb_disasm
288 LIBDISASM := libdisasm.a
289 VPATH += lib/disasm lib/disasm/elf lib/disasm/include \
290 lib/disasm/include/opcode lib/disasm/opcodes \
291 lib/disasm/libiberty lib/disasm/bfd
292 PRIVATE_INCDIR += lib/disasm lib/disasm/elf lib/disasm/include \
293 lib/disasm/include/opcode lib/disasm/opcodes \
294 lib/disasm/libiberty lib/disasm/bfd
295 PRIVATE_INCDIR += lib/disasm
296 CXXSRC_LIBDISASM := disasm.cc
297 CSRC_LIBDISASM := dis-init.c i386-dis.c dis-buf.c
298 NOOPT += $(patsubst %.o, %, $(OBJ_LIBDISASM))
303 # LIBPERFCTR subsystem (only for Jdb)
305 LIBPERFCTR := libperfctr.a
307 PRIVATE_INCDIR += lib/perfctr
308 CSRC_LIBPERFCTR := event_set_p5.c event_set_p6.c event_set_amd.c \
309 event_set_p4.c event_set_x86.c perfctr.c \
311 NOOPT += $(patsubst %.o, %, $(OBJ_LIBPERFCTR))
314 # LIBREGEX subsystem (only for Jdb)
316 LIBREGEX := libregex.a
318 PRIVATE_INCDIR += lib/regex
319 CSRC_LIBREGEX := alloc.c rx.c
320 NOOPT += $(patsubst %.o, %, $(OBJ_LIBREGEX))
322 ifneq ($(wildcard $(srcdir)/lib/perfctr),)
323 SUBSYSTEMS += LIBPERFCTR
324 KERNEL_EXTRA_LIBS += $(LIBPERFCTR)
325 KERNEL_UNRES_SYMS += -u perfctr_set_cputype
328 ifneq ($(wildcard $(srcdir)/lib/regex),)
329 SUBSYSTEMS += LIBREGEX
330 KERNEL_EXTRA_LIBS += $(LIBREGEX)
331 PREPROCESS_PARTS += jdb_regex
337 # disabled until unittests fixed
339 SUBSYSTEMS += UNITTEST
342 INTERFACES_UNITTEST += mapdb_t map_util_t
344 # Compile all unit tests without -DNDEBUG.
345 NONDEBUG += $(patsubst %.o, %, $(OBJ_UNITTEST))
348 MODULES_FILES = $(MODULES_FILE) $(MODULES_FILE_BSP)
354 VPATH += lib/minilibc/ia32 lib/minilibc
355 CSRC_MINILIBC := printf.c __v_printf.c \
356 vprintf.c lltostr.c __ltostr.c \
357 putchar.c puts.c gets.c sprintf.c \
358 snprintf.c vsnprintf.c vsprintf.c fprintf.c \
359 memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \
360 strcpy.c strlen.c strstr.c \
361 strcmp.c strcspn.c strncmp.c strspn.c
363 # do not profile all of MINILIBC, because it is used in the BOOT subsystem
364 NOOPT += $(patsubst %.o, %, $(OBJ_MINILIBC))