Skip to content

Commit 076f0a9

Browse files
committed
Fix libmmtk_ruby.a building in extconf.rb
Since libmmtk_ruby.a was a PHONY target, it caused the shared object to not be rebuilt even though libmmtk_ruby.a was updated.
1 parent 02b9439 commit 076f0a9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gc/mmtk/extconf.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99

1010
makefile = File.read("Makefile")
1111

12-
# Modify the `all` target to run the `mmtk` target first
13-
makefile.gsub!(/^all:\s+(.*)$/, 'all: mmtk \1')
12+
makefile.prepend("MMTK_BUILD=debug\n")
1413

15-
# Add the `mmtk` target to run `cargo build`
16-
makefile << <<~'MAKEFILE'
17-
$(srcdir)/mmtk.c: mmtk
14+
# Add `libmmtk_ruby.a` as an object file
15+
makefile.gsub!(/^OBJS = (.*)$/, "OBJS = \\1 $(MMTK_BUILD)/libmmtk_ruby.#{RbConfig::CONFIG["LIBEXT"]}")
1816

19-
MMTK_BUILD=debug
17+
# Modify the `all` target to run the `libmmtk_ruby.a` target first
18+
makefile.gsub!(/^all:\s+(.*)$/, "all: $(MMTK_BUILD)/libmmtk_ruby.#{RbConfig::CONFIG["LIBEXT"]} \\1")
2019

21-
.PHONY: mmtk
22-
mmtk:
20+
# Add the `libmmtk_ruby.a` target to run `cargo build`
21+
makefile << <<~MAKEFILE
22+
$(MMTK_BUILD)/libmmtk_ruby.#{RbConfig::CONFIG["LIBEXT"]}: $(wildcard $(srcdir)/src/*.rs) $(srcdir)/Cargo.toml $(srcdir)/Cargo.toml
2323
$(Q) case $(MMTK_BUILD) in \
2424
release) \
2525
CARGO_TARGET_DIR="." cargo build --manifest-path=$(srcdir)/Cargo.toml --release \

0 commit comments

Comments
 (0)