From 44fa14076985405d8390d50b92f6a2fdbcb7f751 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 1 Sep 2025 09:57:18 +0200 Subject: Support simple variable assignment --- Rakefile | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 3c9a245..b199aff 100644 --- a/Rakefile +++ b/Rakefile @@ -44,13 +44,15 @@ task :convert do end end +rule /^build\/[[:alpha:]]+\/stage[[:digit:]]+$/ => ->(match) { + "#{match}.s" +} do |t| + sh CROSS_GCC, '-nostdlib', '-o', t.name, *t.prerequisites +end + STAGES.each do |stage| previous = stage.delete_prefix('stage').to_i.pred - file "build/valid/#{stage}" => "build/valid/#{stage}.s" do |t| - sh CROSS_GCC, '-nostdlib', '-o', t.name, *t.prerequisites - end - file "build/valid/#{stage}.s" => ["build/boot/#{stage}", "boot/#{stage}.elna"] do |t| exe, source = t.prerequisites @@ -61,10 +63,6 @@ STAGES.each do |stage| IO.copy_stream last_stdout, t.name end - file "build/boot/#{stage}" => "build/boot/#{stage}.s" do |t| - sh CROSS_GCC, '-nostdlib', '-o', t.name, *t.prerequisites - end - file "build/boot/#{stage}.s" => ["build/valid/stage#{previous}", "boot/#{stage}.elna"] do |t| exe, source = t.prerequisites @@ -80,12 +78,6 @@ end # Stage 1. # -file 'build/valid/stage1' => ['build/valid', 'build/valid/stage1.s'] do |t| - source = t.prerequisites.select { |prerequisite| prerequisite.end_with? '.s' } - - sh CROSS_GCC, '-nostdlib', '-o', t.name, *source -end - file 'build/valid/stage1.s' => ['build/boot/stage1', 'boot/stage1.s', 'build/valid'] do |t| source, exe, = t.prerequisites.partition { |prerequisite| prerequisite.end_with? '.s' } -- cgit v1.2.3