summaryrefslogtreecommitdiff
path: root/rakelib
diff options
context:
space:
mode:
Diffstat (limited to 'rakelib')
-rw-r--r--rakelib/cross.rake14
-rw-r--r--rakelib/stage.rake10
2 files changed, 8 insertions, 16 deletions
diff --git a/rakelib/cross.rake b/rakelib/cross.rake
index f90bb84..b390590 100644
--- a/rakelib/cross.rake
+++ b/rakelib/cross.rake
@@ -309,17 +309,6 @@ namespace :cross do
sh env, 'make', '-j', Etc.nprocessors.to_s, chdir: cwd.to_path
sh env, 'make', 'install', chdir: cwd.to_path
end
-
- task :init, [:target] do |_, args|
- options = find_build_target GCC_VERSION, args
- env = {
- 'PATH' => "#{options.rootfs.realpath + 'bin'}:#{ENV['PATH']}"
- }
- sh env, 'riscv32-unknown-linux-gnu-gcc',
- '-ffreestanding', '-static',
- '-o', (options.tools + 'init').to_path,
- 'tools/init.c'
- end
end
desc 'Build cross toolchain'
@@ -329,7 +318,6 @@ task cross: [
'cross:headers',
'cross:kernel',
'cross:glibc',
- 'cross:gcc2',
- 'cross:init'
+ 'cross:gcc2'
] do
end
diff --git a/rakelib/stage.rake b/rakelib/stage.rake
index 80f704d..6f61cae 100644
--- a/rakelib/stage.rake
+++ b/rakelib/stage.rake
@@ -21,16 +21,20 @@ def assemble_stage(output, compiler, source)
end
end
+library = []
+
Dir.glob('boot/*.s').each do |assembly_source|
- target_object = Pathname.new('build/boot') + Pathname.new(assembly_source).basename.sub_ext('.o')
+ source_basename = Pathname.new(assembly_source).basename
+ target_object = Pathname.new('build/boot') + source_basename.sub_ext('.o')
file target_object.to_s => [assembly_source, 'build/boot'] do |t|
sh CROSS_GCC, '-c', '-o', t.name, assembly_source
end
+ library << assembly_source unless source_basename.to_s.start_with? 'stage'
end
desc 'Initial stage'
-file 'build/boot/stage1' => ['build/boot/tokenizer.o', 'build/boot/stage1.o', 'build/boot/common-boot.o'] do |t|
+file 'build/boot/stage1' => ['build/boot/stage1.o', *library] do |t|
sh CROSS_GCC, '-nostdlib', '-o', t.name, *t.prerequisites
end
@@ -43,7 +47,7 @@ file 'build/boot/stage2a.s' => ['build/boot/stage1', 'boot/stage2.elna'] do |t|
end
['build/boot/stage2a', 'build/boot/stage2b'].each do |exe|
- file exe => [exe.ext('.s'), 'build/boot/common-boot.o'] do |t|
+ file exe => [exe.ext('.s'), *library] do |t|
sh CROSS_GCC, '-nostdlib', '-o', t.name, *t.prerequisites
end
end