aboutsummaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-04 12:56:13 +0200
committerEugen Wissner <belka@caraus.de>2026-10-04 12:56:13 +0200
commit5b7f983b3912a8d0fbeaf22f7fe0e2c5f1e0ff01 (patch)
tree138f5e022066e3ad013c795c38dc4a739c3e93af /Rakefile
parent8a6ed3a4ddf9c4e16bb4ddc3b8c5094bb937598b (diff)
downloadelna-5b7f983b3912a8d0fbeaf22f7fe0e2c5f1e0ff01.tar.gz
Generate a dependency tree for rake
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile28
1 files changed, 2 insertions, 26 deletions
diff --git a/Rakefile b/Rakefile
index ff537ec..a5e0ebd 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,37 +3,13 @@
# obtain one at https://mozilla.org/MPL/2.0/. -}
# frozen_string_literal: true
-require 'pathname'
require 'rake/clean'
-CLEAN.include 'build/gcc'
CLOBBER.include 'build'
-task default: :source
-
-task source: ['source/main.elna', 'build/gcc/elna'] do |t|
+task default: 'source/main.elna'
+task default: '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', '-I', 'source', '-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