Build documentation

This commit is contained in:
2025-11-25 16:20:48 +01:00
parent c20d9b7240
commit b5b129a90c
6 changed files with 100 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
require 'open3'
require 'pathname'
require 'rake/clean'
require 'asciidoctor-pdf'
STAGES = Dir.glob('boot/stage*')
.collect { |stage| File.basename stage }
@@ -13,6 +14,7 @@ STAGES = Dir.glob('boot/stage*')
.drop(1) # First assembly stage does not count.
CLEAN.include 'build/boot', 'build/valid'
CLEAN.include 'doc/*.pdf'
def compile(*arguments)
sh(ENV.fetch('CC', 'gcc'), '-fpie', '-g', *arguments)
@@ -126,3 +128,10 @@ file 'build/boot/stage1/cl' => ['build/boot/stage1', 'boot/stage1.s'] do |t|
compile('-nostdlib', '-o', t.name, *source)
end
rule '.pdf' => '.adoc' do |t|
Asciidoctor.convert_file t.source, backend: 'pdf', safe: :safe
end
desc 'Generate documentation'
task doc: 'doc/language.pdf'