diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-09-02 18:52:08 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-09-03 08:23:47 +0200 |
| commit | ed3e0e043c7334064a10559c73b225fe4ca3e128 (patch) | |
| tree | 79fed4c10a8b13e220e05b0753df8690cb0b6998 /Rakefile | |
| parent | 44fa14076985405d8390d50b92f6a2fdbcb7f751 (diff) | |
| download | elna-ed3e0e043c7334064a10559c73b225fe4ca3e128.tar.gz | |
Implement arithmetic negation
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -6,7 +6,6 @@ require 'open3' require 'rake/clean' -CROSS_GCC = '../eugenios/build/rootfs/bin/riscv32-unknown-linux-gnu-gcc' SYSROOT = '../eugenios/build/sysroot' QEMU = 'qemu-riscv32' STAGES = Dir.glob('boot/stage*.elna').collect { |stage| File.basename stage, '.elna' }.sort @@ -16,6 +15,10 @@ CLEAN.include 'build/boot', 'build/valid' directory 'build/boot' directory 'build/valid' +def compile(input, output) + sh ENV.fetch('CC', 'gcc'), '-nostdlib', '-o', output, input +end + task default: :boot desc 'Final stage' @@ -47,7 +50,7 @@ end rule /^build\/[[:alpha:]]+\/stage[[:digit:]]+$/ => ->(match) { "#{match}.s" } do |t| - sh CROSS_GCC, '-nostdlib', '-o', t.name, *t.prerequisites + compile(*t.prerequisites, t.name) end STAGES.each do |stage| @@ -91,5 +94,5 @@ end file 'build/boot/stage1' => ['build/boot', 'boot/stage1.s'] do |t| source = t.prerequisites.select { |prerequisite| prerequisite.end_with? '.s' } - sh CROSS_GCC, '-nostdlib', '-o', t.name, *source + compile(*source, t.name) end |
