mruby · GitHub

Commit d995ca2

matzclaude

and

committed

build: add amalgamation support via rake amalgam task

Add ability to generate combined mruby.h and mruby.c files for single-file embedding, similar to SQLite's amalgamation. Usage: rake amalgam Output: build/<target>/amalgam/mruby.{h,c} Features: - Headers concatenated in dependency order with guards stripped - Sources concatenated with proper ordering (core, gems, mrblib) - X-macro headers (ops.h) inlined at each include point - Local includes automatically inlined - Handles both src/ and core/ gem directory conventions Co-authored-by: Claude <noreply@anthropic.com>

3 files changed

Lines changed: 583 additions & 0 deletions

File tree

  • lib/mruby

  • tasks

Lines changed: 1 addition & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -37,6 +37,7 @@ load "#{MRUBY_ROOT}/tasks/test.rake"

3737

load "#{MRUBY_ROOT}/tasks/benchmark.rake"

3838

load "#{MRUBY_ROOT}/tasks/doc.rake"

3939

load "#{MRUBY_ROOT}/tasks/install.rake"

40+

load "#{MRUBY_ROOT}/tasks/amalgam.rake"

4041
4142

##############################

4243

# generic build targets, rules

Read the original on github.com ↗