rmake is a make-compatible build runner implemented in mruby with the explicit goal of
building CRuby across platforms using a single make engine.
This repository is intentionally minimal today: we’re defining the MVP scope and scaffolding a clean, testable architecture so we can grow compatibility in a controlled way.
- Run enough of CRuby’s Makefiles to build a default CRuby on supported platforms.
- Prefer compatibility with standard make behavior first, then GNU Make where it matters.
- Keep the implementation small and testable; native extensions are used only when needed.
This is a mruby gem-style layout.
mrbgem.rakedefines the gem.mrblib/contains the mruby sources.tools/rmakeis the CLI entrypoint (invoked viamruby tools/rmake).
Use the top-level Rakefile for both tests and packaging:
rake -TMain tasks:
rake test(same asrake test:all)rake test:unitrake test:microrake test:gnurake build(same asrake build:rmake)rake build:rmake_no_cleanrake rmake:clean
rmake ships a local mruby build under mruby/ and includes mruby-file-stat for fast File.mtime.
File.mtime support is required.
cd mruby
make clean all/path/to/mruby/bin/mruby tools/rmake [options] [target] [VAR=VALUE]Options:
-f FILERead FILE as a makefile-j NRun N jobs in parallel-nDry-run (print commands without running)-qQuestion mode (exit 0/1/2 without running recipes)-dTrace target evaluation and skips
Build a standalone rmake binary (contains mruby + rmake bytecode):
rake build:rmakeOutput:
dist/rmake-<os>-<arch>(or.exeon Windows)
Optional env vars:
RMAKE_NO_CLEAN=1skipmrubyclean before buildRMAKE_OUT_TAG=<tag>override output suffixCC=<compiler>override C compiler for launcher linkRMAKE_EXTRA_LDFLAGS="..."extra linker flagsRMAKE_TOOLCHAIN=<toolchain>force mruby toolchain (gcc,clang, etc)
- Parser/evaluator/executor are in
mrblib/with a growing test suite. - Standard make compatibility is the current focus before GNU make extensions.
- Variable assignments:
=,:=,+= - Conditionals:
ifeq,ifneq,else ifeq,else ifneq,else,endif - Includes:
include,-include,!include - Targets and recipes, order-only prerequisites (
|) - Suffix rules like
.c.o: .PHONY,.PRECIOUS,.DELETE_ON_ERROR- VPATH search for prerequisites
-jparallel builds (whenProcess.spawnis available)-ndry-run prints commands (even for@lines, like GNU make)-dtrace mode for debugging
- GNU make functions like
$(if ...),$(or ...),$(and ...),$(filter ...),$(eval ...),$(call ...) - Pattern rules (
%) and advanced automatic variables .ONESHELL,.SECONDEXPANSION, and other GNU make extensions
rake testtest/run_gnumake_compat.rb downloads GNU make's run_make_tests.pl at runtime
(default URLs:
https://cgit.git.savannah.gnu.org/cgit/make.git/plain/tests/run_make_tests.pl,
https://raw.githubusercontent.com/mirror/make/master/tests/run_make_tests.pl).
If tmp/run_make_tests.pl exists, it is used as-is and no download is attempted.
Set RUN_MAKE_TESTS_FETCH=0 to forbid downloads (missing local file then fails).
tmp/ and work/ are scratch directories. They are intentionally ignored by git
and can be removed at any time.
test/run_all.rb is the integrated suite runner. It executes:
- local regression tests (
test/run.rb) - gmake micro-compat tests (
test/run_gnumake_compat.rb) - GNU
run_make_tests.plselected categories viatest/rmake-make-driver.pl
Useful env vars:
GNU_MAKE_TESTS_DIR=/path/to/make/teststo use a pre-existing GNU test treeRMAKE_GNU_TESTS_FETCH=0to disable automatic clone of GNU make testsRMAKE_GNU_CATEGORIES=cat1,cat2,...to run a subset of GNU categoriesRMAKE_GNU_PROGRESS_SEC=20to print periodic progress while GNU categories runRMAKE_GNU_TIMEOUT=1200to set timeout seconds for GNU categories step
.github/workflows/build-rmake.yml builds rmake artifacts for:
- Linux x86_64
- macOS x86_64
- macOS arm64
- Windows x86_64
- Tighten standard make compatibility and fixture coverage
- Implement minimal GNU make functions required by CRuby build