mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Added conditional configuration flag -c to build.py
This commit is contained in:
5
build.py
5
build.py
@@ -16,12 +16,13 @@ from configure import *
|
||||
from config.parse_options import *
|
||||
|
||||
def main():
|
||||
build_parse_options()
|
||||
options, args = build_parse_options()
|
||||
|
||||
#
|
||||
# Configure
|
||||
#
|
||||
configure_kernel(CML2_CML_FILE)
|
||||
if options.config or not os.path.exists(CML2_OLDCONFIG_FILE):
|
||||
configure_kernel(CML2_CML_FILE)
|
||||
|
||||
#
|
||||
# Build the kernel
|
||||
|
||||
@@ -18,9 +18,11 @@ def build_parse_options():
|
||||
|
||||
parser.add_option("-a", "--arch", type = "string", dest = "arch",
|
||||
help = "Use configuration file for architecture")
|
||||
parser.add_option("-c", "--num-containers", type = "int", dest = "ncont",
|
||||
parser.add_option("-n", "--num-containers", type = "int", dest = "ncont",
|
||||
help = "Maximum number of containers that will be "
|
||||
"made available in configuration")
|
||||
parser.add_option("-c", "--configure-first", action = "store_true", dest = "config",
|
||||
help = "Tells the build script to run configurator first")
|
||||
parser.add_option("-f", "--use-file", dest = "cml_file",
|
||||
help = "Supply user-defined cml file "
|
||||
"(Use only if you want to override default)")
|
||||
@@ -56,4 +58,4 @@ def build_parse_options():
|
||||
else:
|
||||
print "Deleting %s" % CML2_OLDCONFIG_FILE
|
||||
os.remove(CML2_OLDCONFIG_FILE)
|
||||
|
||||
return options, args
|
||||
|
||||
@@ -23,7 +23,8 @@ int fileio(void)
|
||||
memset(filename, 0, 128);
|
||||
sprintf(filename, "/home/bahadir/newfile%d.txt", tid);
|
||||
if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU)) < 0) {
|
||||
test_printf("OPEN: %d", errno);
|
||||
test_printf("OPEN: %d", -errno);
|
||||
test_printf("While trying to open %s\n", filename);
|
||||
goto out_err;
|
||||
}
|
||||
test_printf("%d: Created %s\n", tid, filename);
|
||||
|
||||
@@ -17,7 +17,7 @@ int forktest(void)
|
||||
|
||||
|
||||
/* 16 forks */
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 1; i++) {
|
||||
test_printf("%d: Forking...\n", getpid());
|
||||
if (fork() < 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -53,7 +53,7 @@ def build_posix_container(projpaths, container):
|
||||
print POSIXDIR
|
||||
print '\nBuilding the Posix Container...'
|
||||
scons_cmd = 'scons ' + 'cont=' + str(container.id)
|
||||
print "Issuing scons command: %s" % scons_cmd
|
||||
#print "Issuing scons command: %s" % scons_cmd
|
||||
os.system(scons_cmd)
|
||||
builddir = source_to_builddir(POSIXDIR, container.id)
|
||||
os.path.walk(builddir, glob_by_walk, ['*.elf', images])
|
||||
|
||||
Reference in New Issue
Block a user