diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-01-20 22:10:14 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-01-20 22:10:14 +0100 |
commit | bfa24f7e97eebd26561d87bbab643a9825e93392 (patch) | |
tree | 7ad08394088a0e4b7d51e0f75bdb963e4b9204ee /modules/foo/SConscript | |
parent | c9961af38885b92a86e61e54286c2e60b1585359 (diff) |
Added foo-module.
Diffstat (limited to 'modules/foo/SConscript')
-rw-r--r-- | modules/foo/SConscript | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/foo/SConscript b/modules/foo/SConscript new file mode 100644 index 0000000..a79de34 --- /dev/null +++ b/modules/foo/SConscript @@ -0,0 +1,30 @@ +Import('env') + +env = env.Clone( + CC = 'i386-elf-gcc', + CCFLAGS = '-Wall -W -nostdinc -fno-builtin -fno-hosted -ggdb -std=gnu99', + LINK = 'i386-elf-ld', + LINKFLAGS = '-nostdinc -nostdlib', +) + +def kernel_bld_generator(source, target, env, for_signature): + link_script = None + for s in source: + if s.suffix == '.ld': + link_script = s + break + if not link_script: + Exit(1) + return '$LINK $LINKFLAGS -o %s -T %s %s ' % (target[0], link_script, ' '.join(str(s) for s in source if s != link_script)) + +kernel_bld = Builder( + generator = kernel_bld_generator, + suffix = '', + src_suffix = '.o', + src_builder = 'Object', + target_scanner = ProgramScanner +) + +env.Append(BUILDERS = {'Kernel' : kernel_bld}) + +kernel = env.Kernel('foo', ['foo.ld', 'foo.c']) |