summaryrefslogtreecommitdiff
path: root/gc/mmtk/extconf.rb
blob: c0e788037ecfe41834c41f755e5f6a080be6d1d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require_relative "../extconf_base"

# Statically link `libmmtk_ruby.a`
$LIBS << " $(MMTK_BUILD)/$(LIBMMTK_RUBY)"

rustsrcs = Dir.glob("src/*.rs", base: __dir__).map {|s| "$(srcdir)/#{s}"}

create_gc_makefile("mmtk") do |makefile|
  [
    *makefile,

    <<~MAKEFILE,
    MMTK_BUILD = debug
    LIBMMTK_RUBY = libmmtk_ruby.#$LIBEXT
    RUSTSRCS = #{rustsrcs.join(" \\\n\t   ")}

    ifeq ($(MMTK_BUILD), debug)
    CPPFLAGS += -DMMTK_DEBUG
    endif
    MAKEFILE
  ]
end