elna/Rakefile

40 lines
936 B
Ruby

require 'pathname'
require 'rake/clean'
require_relative 'rakelib/shared'
CLOBBER.include TMP
task :default do
sh 'make -C build'
sh './build/bin/elna'
end
desc 'Build the bootstrap compiler'
task :boot do
# MacOS:
# ---
# CC=gcc-14 CXX=g++-14 \
# CFLAGS="-I/opt/homebrew/Cellar/flex/2.6.4_2/include" \
# CXXFLAGS="-I/opt/homebrew/Cellar/flex/2.6.4_2/include" \
# ../gcc-14.2.0/configure \
# --disable-bootstrap \
# --enable-languages=c,c++,elna \
# --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk \
# --prefix=$(realpath ../gcc-install)
end
desc 'Build cross toolchain'
task :cross, [:target] do |_, args|
args.with_defaults target: 'riscv32-unknown-linux-gnu'
options = find_build_target GCC_VERSION, args[:target]
options.tools.mkpath
binutils options
gcc1 options
headers options
kernel options
glibc options
gcc2 options
Rake::Task['cross:init'].invoke args[:target]
end