diff options
| -rw-r--r-- | gc/mmtk/extconf.rb | 37 | ||||
| -rw-r--r-- | gc/mmtk/mmtk.c (renamed from gc/mmtk.c) | 2 | ||||
| -rw-r--r-- | gc/mmtk/mmtk.h (renamed from gc/mmtk.h) | 0 |
3 files changed, 38 insertions, 1 deletions
diff --git a/gc/mmtk/extconf.rb b/gc/mmtk/extconf.rb new file mode 100644 index 0000000000..b2cd9401f0 --- /dev/null +++ b/gc/mmtk/extconf.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require_relative "../extconf_base" + +# Statically link `libmmtk_ruby.a` +$LIBS << " $(MMTK_BUILD)/libmmtk_ruby.#{RbConfig::CONFIG["LIBEXT"]}" + +create_gc_makefile("mmtk") + +makefile = File.read("Makefile") + +# Modify the `all` target to run the `mmtk` target first +makefile.gsub!(/^all:\s+(.*)$/, 'all: mmtk \1') + +# Add the `mmtk` target to run `cargo build` +makefile << <<~'MAKEFILE' + $(srcdir)/mmtk.c: mmtk + + MMTK_BUILD=debug + + .PHONY: mmtk + mmtk: + $(Q) case $(MMTK_BUILD) in \ + release) \ + CARGO_TARGET_DIR="." cargo build --manifest-path=$(srcdir)/Cargo.toml --release \ + ;; \ + debug) \ + CARGO_TARGET_DIR="." cargo build --manifest-path=$(srcdir)/Cargo.toml \ + ;; \ + *) \ + $(ECHO) Unknown MMTK_BUILD=$(MMTK_BUILD) \ + exit 1 \ + ;; \ + esac +MAKEFILE + +File.open("Makefile", "w") { |file| file.puts(makefile) } diff --git a/gc/mmtk.c b/gc/mmtk/mmtk.c index 7e4d54cb88..4e964a6add 100644 --- a/gc/mmtk.c +++ b/gc/mmtk/mmtk.c @@ -7,7 +7,7 @@ #include "gc/gc.h" #include "gc/gc_impl.h" -#include "gc/mmtk.h" +#include "gc/mmtk/mmtk.h" #include "ccan/list/list.h" #include "darray.h" diff --git a/gc/mmtk.h b/gc/mmtk/mmtk.h index 44c660c665..44c660c665 100644 --- a/gc/mmtk.h +++ b/gc/mmtk/mmtk.h |
