diff --git a/SConstruct b/SConstruct index f6ecbf3..a66b7d4 100644 --- a/SConstruct +++ b/SConstruct @@ -83,8 +83,6 @@ else : ENV = {'PATH': os.environ['PATH']}, configFiles = ('#' + cml2CompileRulesFile, '#' + cml2ConfigPropertiesFile, '#' + cml2ConfigHeaderFile)) - kernelSConscriptPaths = ['generic', 'api', 'lib'] - # It is assumed that the C code is assuming that the configuration file will be found at l4/config.h so create it there. # # Kernel code include config.h in a different way to all the other bits of code. @@ -111,15 +109,10 @@ else : if items[1] == 'SUBARCH': subarch = items[2].lower() if items[0] == 'DRIVER': - kernelSConscriptPaths.append('drivers/' + ('irq' if items[1] == 'IRQCTRL' else items[1].lower()) + '/' + items[2].lower()) + configuration.env.Append(driverList = [('irq' if items[1] == 'IRQCTRL' else items[1].lower()) + '/' + items[2].lower()]) configuration.Define('__ARCH__', arch) configuration.Define('__PLATFORM__', platform) configuration.Define('__SUBARCH__', subarch) - kernelSConscriptPaths += [ - 'arch/' + arch, - 'glue/' + arch, - 'platform/' + platform, - 'arch/' + arch + '/' + subarch] configuration.env['ARCH'] = arch configuration.env['PLATFORM'] = platform configuration.env['SUBARCH'] = subarch @@ -169,11 +162,8 @@ else : CPPFLAGS = ['-include', 'config.h', '-include', 'cml2Config.h', '-include', 'macros.h', '-include', 'types.h', '-D__KERNEL__']) - kernelComponents = [] - for scriptPath in ['src/' + path for path in kernelSConscriptPaths]: - kernelComponents.append(SConscript(scriptPath + '/SConscript', variant_dir = buildDirectory + '/' + scriptPath, duplicate = 0, exports = {'environment': kernelEnvironment})) - startAxf = kernelEnvironment.Program(buildDirectory + '/start.axf', kernelComponents) - Depends(kernelComponents + [startAxf], kernelEnvironment['configFiles']) + startAxf = SConscript('src/SConscript' , variant_dir = buildDirectory + '/kernel' , duplicate = 0, exports = {'environment': kernelEnvironment}) + Depends(startAxf, kernelEnvironment['configFiles']) Alias('kernel', startAxf) @@ -276,6 +266,13 @@ else : Alias('final', loader) + # The test does not terminate and Ctrl-C and Ctrl-Z have no effect. Run the job in the background so + # the initiating terminal retains control and allows the process to be killed from this terminal. Add + # the sleep to force SCons to wait until the test has run before it decides all targets are built and + # return to the prompt. Remind the user they have a running process in the background. + + Command('runTest', loader, "qemu-system-arm -kernel $SOURCE -nographic -m 128 -M versatilepb & sleep 10 ; echo '####\\n#### You will need to kill the qemu-system-arm process\\n#### that is running in the background.\\n####\\n'") + ########## Other rules. ######################## Default(crts.values() + libs.values() + [libelf, startAxf] + tasks + bootdesc + loader) diff --git a/src/api/SConscript b/src/SConscript similarity index 51% rename from src/api/SConscript rename to src/SConscript index 7646bb9..711a559 100644 --- a/src/api/SConscript +++ b/src/SConscript @@ -19,6 +19,26 @@ Import('environment') -objects = environment.Object(Glob('*.c')) +# The fixed sources and easily selected ones. -Return('objects') +sources = \ + Glob('api/*.[cS]') + \ + Glob('generic/*.[cS]') + \ + Glob('lib/*.[cS]') + \ + Glob('arch/' + environment['ARCH'] + '/*.[cS]') + \ + Glob('arch/' + environment['ARCH'] + '/' + environment['SUBARCH'] +'/*.[cS]') + \ + Glob('glue/' + environment['ARCH'] + '/*.[cS]') + \ + Glob('platform/' + environment['PLATFORM'] + '/*.[cS]') + +# The not so easily selected sources. + +for item in environment['driverList'] : + sources += Glob('drivers/' + item + '/*.[cS]') + +objects = environment.Object(sources) +Depends(objects, environment['configFiles']) + +startAxf = environment.Program('start.axf', objects) +Depends(startAxf, environment['configFiles']) + +Return('startAxf') diff --git a/src/arch/arm/SConscript b/src/arch/arm/SConscript deleted file mode 100644 index 1aaa68a..0000000 --- a/src/arch/arm/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c') + Glob('*.S')) - -Return('objects') diff --git a/src/arch/arm/v5/SConscript b/src/arch/arm/v5/SConscript deleted file mode 100644 index 1aaa68a..0000000 --- a/src/arch/arm/v5/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c') + Glob('*.S')) - -Return('objects') diff --git a/src/arch/arm/v6/SConscript b/src/arch/arm/v6/SConscript deleted file mode 100644 index 1aaa68a..0000000 --- a/src/arch/arm/v6/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c') + Glob('*.S')) - -Return('objects') diff --git a/src/drivers/irq/pl190/SConscript b/src/drivers/irq/pl190/SConscript deleted file mode 100644 index 7646bb9..0000000 --- a/src/drivers/irq/pl190/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c')) - -Return('objects') diff --git a/src/drivers/timer/sp804/SConscript b/src/drivers/timer/sp804/SConscript deleted file mode 100644 index 7646bb9..0000000 --- a/src/drivers/timer/sp804/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c')) - -Return('objects') diff --git a/src/drivers/uart/pl011/SConscript b/src/drivers/uart/pl011/SConscript deleted file mode 100644 index 7646bb9..0000000 --- a/src/drivers/uart/pl011/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c')) - -Return('objects') diff --git a/src/generic/SConscript b/src/generic/SConscript deleted file mode 100644 index 7646bb9..0000000 --- a/src/generic/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c')) - -Return('objects') diff --git a/src/glue/arm/SConscript b/src/glue/arm/SConscript deleted file mode 100644 index 7646bb9..0000000 --- a/src/glue/arm/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c')) - -Return('objects') diff --git a/src/lib/SConscript b/src/lib/SConscript deleted file mode 100644 index 7646bb9..0000000 --- a/src/lib/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c')) - -Return('objects') diff --git a/src/platform/pb926/SConscript b/src/platform/pb926/SConscript deleted file mode 100644 index 1aaa68a..0000000 --- a/src/platform/pb926/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -# -*- mode: python; coding: utf-8; -*- - -# Codezero -- a microkernel for embedded systems. -# -# Copyright © 2009 B Labs Ltd -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License along with this program. If not, see -# . -# -# Author: Russel Winder - -Import('environment') - -objects = environment.Object(Glob('*.c') + Glob('*.S')) - -Return('objects')