Generate top-level code from symbol tables

This commit is contained in:
2025-06-19 14:03:03 +02:00
parent f524311f06
commit 6da2a70329
14 changed files with 434 additions and 397 deletions

View File

@ -20,13 +20,15 @@ task default: ['source/main.elna', TMP + 'boot/elna'] do |t|
end
rule(/boot\/.+\.o$/ => ->(file) {
Pathname.new('source') +
source = Pathname.new('source') +
Pathname.new(file).relative_path_from(TMP + 'boot').sub_ext('.elna')
[HOST_INSTALL + 'bin/gelna', source]
}) do |t|
Pathname.new(t.name).dirname.mkpath
compiler = HOST_INSTALL + 'bin/gelna'
sources, compiler = t.prerequisites.partition { |source| source.end_with? '.elna' }
sh compiler.to_path, '-c', '-o', t.name, *t.prerequisites
sh *compiler, '-c', '-O0', '-g', '-o', t.name, *sources
end
file TMP + 'boot/elna' => FileList['source/**/*.elna'].reject { |file|