# architecture independent kernel codes.
#
# (C) 2011-2013 KATO Takeshi
#


kern_sources = [
    'build_info.cc',
    'clock_src.cc',
    'cpu_node.cc',
    'ctype.cc',
    'intr_ctl.cc',
    'io_node.cc',
    'kern_log.cc',
    'log_target.cc',
    'mem_io.cc',
    'mempool.cc',
    'mempool_ctl.cc',
    'message_queue.cc',
    'output_buffer.cc',
    'page.cc',
    'page_pool.cc',
    'pic_dev.cc',
    'process.cc',
    'spinlock.cc',
    'spinrwlock.cc',
    'string.cc',
    'thread.cc',
    'thread_queue.cc',
    'timer_ctl.cc',
    'timer_liner_q.cc',
]


mb_sources = [
    'ctype.cc',      # necessary to link with string.cc in g++.
    'io_node.cc',
    'log_target.cc',
    'output_buffer.cc',
    'spinlock.cc',
    'string.cc',
]


def build(x):
	x.objects(
	    target   = 'kernel_objs',
	    source   = kern_sources,
	    use      = 'KERNEL',
	)

	if x.env.CONFIG_MULTIBOOT or x.env.CONFIG_MULTIBOOT2:
		x.objects(
		    target   = 'mb_libs',
		    source   = mb_sources,
		    use      = 'MB',
		)


