#
# Build script to autogenerate a bootdesc image
#
# Copyright (C) 2007 Bahadir Balban
#
import os
import sys
import shutil
from os.path import join
from configure import *

config = configuration_retrieve()
builddir = ARGUMENTS.get('builddir', 'build/conts/posix')

env = Environment(CC = config.user_toolchain + 'gcc',
		  CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror'],
		  LINKFLAGS = ['-nostdlib','-Tlinker.lds'],
		  ASFLAGS = ['-D__ASSEMBLY__'],
		  PROGSUFFIX = '.elf',
		  ENV = {'PATH' : os.environ['PATH']},
		  LIBS = 'gcc',
		  CPPPATH = '#include')

bootdesc = env.Program(join(builddir, 'bootdesc.elf'), join(builddir, 'bootdesc.c'))
Default(bootdesc)
