]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/Modules.ux
update
[l4.git] / kernel / fiasco / src / Modules.ux
1 # -*- makefile -*-
2
3 SUBSYSTEMS = JABI ABI DRIVERS KERNEL LIBK CXXLIB JDB \
4              TCBOFFSET SYMBOLS VERSION GBLCFG MINILIBC
5
6 ifeq ("$(CONFIG_GSTABS)","y")     
7   SUBSYSTEMS            += LINES
8 endif
9
10 PREPROCESS_PARTS        += arch $(CONFIG_ABI) 32bit $(CONFIG_XARCH)    \
11                            fpu jdb_thread_names iofp \
12                            obj_space_phys abs_syscalls auto_map_kip \
13                            kernel_can_exit
14
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
23
24 PREPROCESS_PARTS        += $(PREPROCESS_PARTS-y)
25
26 #
27 # TYPES subsystem
28 #
29 PRIVATE_INCDIR          += types/$(CONFIG_XARCH) types
30
31 #
32 # ABI Subsystem
33 #
34 ABI                     := libabi.a
35 VPATH                   += abi/ia32 abi
36 INTERFACES_ABI          := l4_fpage l4_msg_item l4_buf_desc kip l4_types \
37                            l4_error
38
39 kip_IMPL                := kip kip-ia32 kip-debug kip-ia32-debug
40 l4_types_IMPL           := l4_types l4_types-debug
41
42 #
43 # JABI Subsystem
44 #
45 JABI                    := libjabi.a
46 VPATH                   += jabi/$(CONFIG_XARCH) jabi
47 INTERFACES_JABI         := jdb_ktrace
48
49 #
50 # DRIVERS subsystem
51 #
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 \
56                            delayloop mem
57
58 processor_IMPL          := processor processor-ux
59 mem_IMPL                := mem mem-ia32
60
61 #
62 # KERNEL subsystem
63 #
64 KERNEL                  := fiasco.image
65 KERNEL_EXTRA            := irq0
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
69
70 KERNEL_EXTRA-$(CONFIG_UX_CON)  += ux_con
71 KERNEL_EXTRA-$(CONFIG_UX_NET)  += ux_net
72 KERNEL_EXTRA            += $(KERNEL_EXTRA-y)
73
74 # KERNEL modules.  
75
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).
80
81 INTERFACES_KERNEL       := mem_region simpleio kernel_console panic warn \
82                            bitmap buddy_alloc irq_pin pages koptions      \
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                                      \
89                            entry_frame continuation                \
90                            kmem mapped_alloc mem_unit  \
91                            ram_quota kmem_alloc ptab_base per_cpu_data_alloc \
92                            ref_ptr ref_obj                                \
93                            slab_cache_anon kmem_slab_simple dbg_page_info   \
94                            vmem_alloc paging kmem_slab 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    \
98                            l4_buf_iter lock  \
99                            mem_space mem_space_sigma0 space vcpu context \
100                            helping_lock \
101                            mp_lock ipc_gate irq_controller                \
102                            mapping mapping_tree mappable                  \
103                            mapdb kobject_mapdb map_util \
104                            hostproc 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 \
109                            syscalls                                       \
110                            kernel_thread dirq dirq_pic_pin                \
111                            banner fpu_alloc irq icu_helper main           \
112                            startup irq_chip libc_support                 \
113                            jdb_dbinfo jdb fb net utcb_init        \
114                            jdb_core jdb_module jdb_table                  \
115                            jdb_thread_list jdb_input jdb_dump jdb_thread  \
116                            jdb_lines jdb_tcb jdb_prompt_module jdb_bt     \
117                            jdb_mapdb jdb_ptab jdb_kern_info jdb_counters  \
118                            glibc_getchar jdb_trace jdb_trace_set          \
119                            tb_entry_output jdb_tbuf_init kern_cnt         \
120                            jdb_tbuf_output jdb_tbuf_show                  \
121                            jdb_misc checksum watchdog terminate           \
122                            jdb_screen push_console jdb_bp                 \
123                            jdb_attach_irq sys_call_page                   \
124                            jdb_timeout gdt factory                        \
125                            idt tss trap_state jdb_prompt_ext              \
126                            jdb_handler_queue jdb_exit_module              \
127                            jdb_halt_thread  jdb_tetris                    \
128                            jdb_kern_info_kip                              \
129                            jdb_kern_info_kmem_alloc jdb_kern_info_config  \
130                            jdb_space jdb_trap_state                       \
131                            vkey jdb_utcb vlog                             \
132                            jdb_entry_frame kdb_ke jdb_ipi app_cpu_thread  \
133                            jdb_rcupdate jdb_kobject jdb_kobject_names     \
134                            jdb_list jdb_ipc_gate jdb_obj_space            \
135                            jdb_log jdb_factory jdb_semaphore scheduler    \
136                            jdb_scheduler clock jdb_sender_list            \
137                            jdb_disasm jdb_regex
138
139 #ifeq ("$(CONFIG_USER_LOCKS)","y")
140   PREPROCESS_PARTS      += ulock
141   INTERFACES_KERNEL     += u_semaphore
142 #endif
143
144
145 boot_info_IMPL          := boot_info boot_info-ia32 boot_info-ux
146 clock_IMPL              := clock clock-ia32
147 config_IMPL             := config config-ia32-32 config-ux
148 context_IMPL            := context context-ia32 context-ia32-32 context-ux \
149                            context-vcpu
150 continuation_IMPL       := continuation-ia32-32-ux
151 cpu_IMPL                := cpu cpu-ia32 cpu-ux cpu-32
152 cpu_lock_IMPL           := cpu_lock cpu_lock-generic
153 dirq_IMPL               := dirq dirq-ia32-ux
154 dirq_pic_pin_IMPL       := dirq_pic_pin dirq_pic_pin-ia32-ux
155 entry_frame_IMPL        := entry_frame entry_frame-ia32-ux                   \
156                            entry_frame-abs-timeout-hack
157 fpu_IMPL                := fpu fpu-ia32-ux fpu-ux
158 irq_IMPL                := irq irq-ux
159 ipi_IMPL                := ipi ipi-ux
160 jdb_IMPL                := jdb jdb-ux jdb-ansi jdb-ia32-ux jdb-thread        \
161                            jdb-int3 jdb-int3-ia32-ux
162 jdb_tcb_IMPL            := jdb_tcb jdb_tcb-ia32-ux
163 jdb_bp_IMPL             := jdb_bp-ia32-ux jdb_bp-ux
164 jdb_bt_IMPL             := jdb_bt-ia32-ux
165 jdb_entry_frame_IMPL    := jdb_entry_frame-ia32
166 jdb_kern_info_IMPL      := jdb_kern_info jdb_kern_info-ux                    \
167                            jdb_kern_info-ia32-ux jdb_kern_info-ia32-amd64
168 jdb_misc_IMPL           := jdb_misc-ia32-amd64
169 jdb_ptab_IMPL           := jdb_ptab jdb_ptab-ia32-ux-arm
170 jdb_screen_IMPL         := jdb_screen jdb_screen-ia32
171 jdb_trace_set_IMPL      := jdb_trace_set jdb_trace_set-ia32-ux
172 kdb_ke_IMPL             := kdb_ke kdb_ke-ia32
173 kernel_thread_IMPL      := kernel_thread kernel_thread-std kernel_thread-ux
174 kip_init_IMPL           := kip_init-ia32
175 kmem_IMPL               := kmem-ia32 kmem-ux
176 kmem_alloc_IMPL         := kmem_alloc kmem_alloc-ia32
177 main_IMPL               := main-ia32-32 main-ux
178 mapping_IMPL            := mapping-ia32-32 mapping
179 map_util_IMPL           := map_util map_util-mem map_util-objs
180 mem_layout_IMPL         := mem_layout mem_layout-ia32 mem_layout-ux
181 mem_space_IMPL          := mem_space mem_space-user mem_space-ia32 \
182                            mem_space-ux
183 mem_unit_IMPL           := mem_unit-ux
184 obj_space_IMPL          := obj_space obj_space-phys
185 paging_IMPL             := paging-ia32-32 paging-ia32 paging
186 perf_cnt_IMPL           := perf_cnt perf_cnt-ia32
187 pic_IMPL                := pic pic-ux
188 pmem_alloc_IMPL         := pmem_alloc pmem_alloc-ia32-ux
189 sched_context_IMPL      := sched_context-wfq sched_context-fixed_prio \
190                            sched_context-fp_wfq sched_context
191 space_IMPL              := space space-ux 
192 syscalls_IMPL           := syscalls syscalls-log
193 sys_call_page_IMPL      := sys_call_page sys_call_page-abs-ux
194 task_IMPL               := task task-ux
195 tb_entry_IMPL           := tb_entry tb_entry-ia32-32
196 terminate_IMPL          := terminate-ux
197 thread_IMPL             := thread thread-ia32 thread-ia32-32 thread-ux       \
198                            thread-ipc thread-pagefault thread-log            \
199                            thread-debug thread-io thread-ulock thread-vcpu
200 timer_IMPL              := timer timer-ia32-amd64-ux timer-ux
201 utcb_init_IMPL          := utcb_init utcb_init-ux
202 vmem_alloc_IMPL         := vmem_alloc vmem_alloc-ia32 vmem_alloc-ux
203 spin_lock_IMPL          := spin_lock spin_lock-ia32
204
205 CXXSRC_KERNEL           := libc_backend_nolock.cc glue_libc_ux.cc
206 ASSRC_KERNEL            := entry-ux.S entry.S sighandler.S \
207                            sys_call_page-asm.S 
208
209 ifeq ($(CONFIG_MP),y)
210 ASSRC_KERNEL            += tramp-mp.S entry-mp.S
211 endif
212
213
214 NOOPT                   += $(filter jdb%,\
215                              $(foreach in,$(INTERFACES_KERNEL), \
216                                $(if $($(in)_IMPL),$($(in)_IMPL),$(in))))
217 NOOPT                   += tb_entry tb_entry_output
218
219 #
220 # TCBOFFSET subsystem
221 #
222 TCBOFFSET               := tcboffset.h
223 CXXSRC_TCBOFFSET        := tcboffset.cc dump_tcboffsets.cc
224
225 #
226 # SYMBOLS subsystem
227 #
228 SYMBOLS                 := Symbols
229
230 #
231 # LINES subsystem
232 #
233 LINES                   := Lines
234 PROG_LINES              := genlines
235
236 #
237 # VERSION subsystem
238 #
239 VERSION                 := version.h
240
241 #
242 # GBLCFG subsystem
243 #
244 GBLCFG                  := gblcfg.o
245 OBJ_KERNEL              += gblcfg.o
246
247 #
248 # CXXLIB Subsystem
249 #
250 CXXLIB                  := libcxx.a
251 VPATH                   += lib/cxxlib
252 INTERFACES_CXXLIB       := s_cruft paranoia
253
254 #
255 # LIBK subsystem
256 #
257 LIBK            := libk.a
258 VPATH           += lib/libk/$(CONFIG_XARCH) lib/libk
259 PRIVATE_INCDIR  += lib/libk/$(CONFIG_XARCH) lib/libk
260 INTERFACES_LIBK := atomic lock_guard auto_ptr std_macros dlist
261
262
263 ifneq ($(CONFIG_JDB_GZIP),)
264  ifneq ($(wildcard $(srcdir)/lib/gzip),)
265   SUBSYSTEMS            += LIBGZIP
266   KERNEL_EXTRA_LIBS     += $(LIBGZIP)
267   INTERFACES_KERNEL     += jdb_gzip
268   LIBGZIP               := libgzip.a
269
270   VPATH                 += lib/gzip
271   PRIVATE_INCDIR        += lib/gzip
272   CSRC_LIBGZIP          := adler32.c crc32.c gzip.c trees.c deflate.c zutil.c
273   NOOPT                 += $(patsubst %.o, %, $(OBJ_LIBGZIP))
274  endif
275 endif
276
277 #
278 # LIBDISASM subsystem (only for Jdb)
279 #
280 ifeq ("$(CONFIG_JDB_DISASM)","y")
281   # $(srcdir)/lib/disasm may be removed
282   ifeq ($(wildcard $(srcdir)/lib/disasm),)
283     $(error $(srcdir)/lib/disasm is missing, disable CONFIG_JDB_DISASM)
284   endif
285
286   SUBSYSTEMS        += LIBDISASM
287   KERNEL_EXTRA_LIBS += $(LIBDISASM)
288   PREPROCESS_PARTS  += jdb_disasm
289
290   LIBDISASM         := libdisasm.a
291   VPATH             += lib/disasm lib/disasm/elf lib/disasm/include \
292                        lib/disasm/include/opcode lib/disasm/opcodes \
293                        lib/disasm/libiberty lib/disasm/bfd
294   PRIVATE_INCDIR    += lib/disasm lib/disasm/elf lib/disasm/include \
295                        lib/disasm/include/opcode lib/disasm/opcodes \
296                        lib/disasm/libiberty lib/disasm/bfd
297   PRIVATE_INCDIR    += lib/disasm
298   CSRC_LIBDISASM    := disasm.c dis-init.c i386-dis.c dis-buf.c
299   NOOPT             += $(patsubst %.o, %, $(OBJ_LIBDISASM))
300 endif
301
302
303 #
304 # LIBPERFCTR subsystem (only for Jdb)
305 #
306 LIBPERFCTR      := libperfctr.a
307 VPATH           += lib/perfctr
308 PRIVATE_INCDIR  += lib/perfctr
309 CSRC_LIBPERFCTR := event_set_p5.c event_set_p6.c event_set_amd.c \
310                    event_set_p4.c event_set_x86.c perfctr.c \
311                    event_set_centaur.c
312 NOOPT           += $(patsubst %.o, %, $(OBJ_LIBPERFCTR))
313
314 #
315 # LIBREGEX subsystem (only for Jdb)
316 #
317 LIBREGEX        := libregex.a
318 VPATH           += lib/regex
319 PRIVATE_INCDIR  += lib/regex
320 CSRC_LIBREGEX   := alloc.c rx.c
321 NOOPT           += $(patsubst %.o, %, $(OBJ_LIBREGEX))
322
323 ifneq ($(wildcard $(srcdir)/lib/perfctr),)
324   SUBSYSTEMS            += LIBPERFCTR
325   KERNEL_EXTRA_LIBS     += $(LIBPERFCTR)
326   KERNEL_UNRES_SYMS     += -u perfctr_set_cputype
327 endif
328
329 ifneq ($(wildcard $(srcdir)/lib/regex),)
330   SUBSYSTEMS            += LIBREGEX
331   KERNEL_EXTRA_LIBS     += $(LIBREGEX)
332   PREPROCESS_PARTS      += jdb_regex
333 endif
334
335 #
336 # UNITTEST subsystem
337 #
338 # disabled until unittests fixed
339 SUBSYSTEMS              += UNITTEST
340 VPATH                   += test/unit
341
342 INTERFACES_UNITTEST     += mapdb_t map_util_t
343
344 # Compile all unit tests without -DNDEBUG.
345 NONDEBUG += $(patsubst %.o, %, $(OBJ_UNITTEST))
346
347 MODULES_FILES = $(MODULES_FILE) $(MODULES_FILE_BSP)
348
349 #
350 # MINILIBC Subsystem
351 #
352 MINILIBC        := libc.a
353 VPATH           += lib/minilibc/ia32 lib/minilibc
354 CSRC_MINILIBC   := printf.c __v_printf.c \
355                    vprintf.c lltostr.c __ltostr.c \
356                    putchar.c puts.c gets.c sprintf.c \
357                    snprintf.c vsnprintf.c vsprintf.c fprintf.c \
358                    memccpy.c  memchr.c   memcmp.c   memcpy.c   memmove.c  memset.c \
359                    strcpy.c   strlen.c   strstr.c   \
360 strcmp.c   strcspn.c  strncmp.c  strspn.c  
361
362 # do not profile all of MINILIBC, because it is used in the BOOT subsystem
363 NOOPT           += $(patsubst %.o, %, $(OBJ_MINILIBC))