summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-09-01 09:57:18 +0200
committerEugen Wissner <belka@caraus.de>2025-09-01 14:53:05 +0200
commit44fa14076985405d8390d50b92f6a2fdbcb7f751 (patch)
tree81b50337b8eba3bd9d34f6ad52b0d7e2f3b764b7 /Rakefile
parent627975775c941130975ce0f9dbef08c723e69794 (diff)
downloadelna-44fa14076985405d8390d50b92f6a2fdbcb7f751.tar.gz
Support simple variable assignment
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile20
1 files changed, 6 insertions, 14 deletions
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' }