diff --git a/loader/SConscript b/loader/SConscript index 6057769..bcc00e0 100644 --- a/loader/SConscript +++ b/loader/SConscript @@ -27,7 +27,7 @@ def ksymToLds(target, source, env): with open(target[0].path, 'w') as asmFile: asmFile.write(''' /* - * %s autogenerated from %s + * %s autogenerated from %s. * * This file is included by the loader sources so that any * kernel symbol address can be known in advance and stopped @@ -50,7 +50,13 @@ def ksymToLds(target, source, env): def createKernelSFile(target, source, env): with open(target[0].path, 'w') as asmFile: asmFile.write(''' -/* This file defines kernel symbols extracted from the kernel image in their physical address */ +/* + * This file is autogenerated. + * + * This file defines kernel symbols extracted from the + * kernel image in their physical address. + */ + .include "%s" .section .kernel @@ -104,10 +110,16 @@ def createLinkerScript(target, source, env): outFile.write(inFile.read().replace('__LINKER_ITEMS_EDIT_MARKER__', linkerItems)) startAxfS = Command('start.axf.S', images[0], ksymToLds) -kernelS = Command('kernel.S', [startAxfS] + images, createKernelSFile) # Order of dependencies is crucial here. + +# In the following, it is crucially important that the order of the sources is as it is -- assumptions are +# made in the functions doing the processing. + +kernelS = Command('kernel.S', [startAxfS] + images, createKernelSFile) mainC = Command('main.c', ['main.c.in'] + images, createMainC) linkerScript = Command('linker.lds', ['linker.lds.in'] + images, createLinkerScript) +## TODO: deal with the situation where there are other .c and .S files in the directory. + objects = environment.Object(['arch.c' , kernelS, startAxfS, mainC]) Depends(objects, environment['configFiles']) Depends(objects, images)