From 5959fbb5524bbeb05a96eb15aba59e961a3efcb7 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 15 Feb 2026 04:10:38 +0100 Subject: Initial commit --- Rakefile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Rakefile (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..4b2ac58 --- /dev/null +++ b/Rakefile @@ -0,0 +1,38 @@ +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. -} +# frozen_string_literal: true + +require 'pathname' +require 'rake/clean' + +CLEAN.include 'build/gcc' + +task default: :source + +task source: ['source/main.elna', 'build/gcc/elna'] do |t| + sources, compiler = t.prerequisites.partition { |f| f.end_with? '.elna' } + + sh *compiler, '--parse', *sources +end + +rule(/gcc\/.+\.o$/ => ->(file) { + source = Pathname.new('source') + + Pathname.new(file).relative_path_from('build/gcc').sub_ext('.elna') + + ['build/host/install/bin/gelna', source] +}) do |t| + Pathname.new(t.name).dirname.mkpath + sources, compiler = t.prerequisites.partition { |source| source.end_with? '.elna' } + + sh *compiler, '-c', '-O0', '-g', '-o', t.name, *sources +end + +file 'build/gcc/elna' => FileList['source/**/*.elna'].reject { |file| + file != file.downcase +}.map { |file| + Pathname.new('build/gcc') + + Pathname.new(file).relative_path_from('source').sub_ext('.o') +} do |t| + sh 'build/host/install/bin/gcc', '-o', t.name, *t.prerequisites +end -- cgit v1.2.3