@@ -26,15 +26,16 @@ SPAWN_HELPER := spawn-helper/spawn-helper
26
26
RUBY_HEADERS := $(wildcard $(ROOT ) /lib/cext/include/* .h) $(wildcard $(ROOT ) /lib/cext/include/* /* .h) $(wildcard $(ROOT ) /lib/cext/include/* /* /* .h)
27
27
RBCONFIG := $(ROOT ) /lib/truffle/rbconfig.rb
28
28
RBCONFIG_MKMF := $(ROOT ) /lib/truffle/rbconfig-for-mkmf.rb
29
- PREPROCESS := $(ROOT ) /lib/cext/preprocess.rb
30
29
MKMF := $(ROOT ) /lib/mri/mkmf.rb
31
- BASIC_EXTCONF_DEPS := $(SPAWN_HELPER ) $(TRUFFLE_POSIX ) $(RUBY_HEADERS ) $(RBCONFIG ) $(RBCONFIG_MKMF ) $(PREPROCESS ) $(MKMF )
32
- # These libraries are needed for try_link() in extconf.rb
33
- EXTCONF_DEPS := $(BASIC_EXTCONF_DEPS ) cext/libtruffleruby.$(DLEXT )
30
+ LIBTRUFFLERUBY = cext/libtruffleruby.$(DLEXT )
31
+ BASIC_EXTCONF_DEPS := $(SPAWN_HELPER ) $(TRUFFLE_POSIX ) $(RUBY_HEADERS ) $(RBCONFIG ) $(RBCONFIG_MKMF ) $(MKMF )
32
+ # C extensions link against libtruffleruby (and might do have_func() checks against it), so it needs to be there before.
33
+ # However, if libtruffleruby is recompiled, there is no need to rebuild C extensions, so it's a order-only-prerequisite.
34
+ EXTCONF_DEPS := $(BASIC_EXTCONF_DEPS ) | $(LIBTRUFFLERUBY )
34
35
35
36
IF_EXTCONF_FAIL := ( echo "` pwd ` /extconf.rb failed:" 1>&2 && cat mkmf.log && false )
36
37
37
- all : cext/libtruffleruby. $( DLEXT ) openssl/openssl.$(DLEXT ) zlib/zlib.$(DLEXT ) \
38
+ all : $( LIBTRUFFLERUBY ) openssl/openssl.$(DLEXT ) zlib/zlib.$(DLEXT ) \
38
39
psych/psych.$(DLEXT ) syslog/syslog.$(DLEXT ) nkf/nkf.$(DLEXT ) \
39
40
etc/etc.$(DLEXT ) rbconfig-sizeof/sizeof.$(DLEXT )
40
41
@@ -44,7 +45,7 @@ clean_truffleposix:
44
45
$(Q ) rm -f $(TRUFFLE_POSIX ) truffleposix/* .o
45
46
46
47
clean_cexts :
47
- $(Q ) rm -f cext/Makefile cext/* .o cext/libtruffleruby. $( DLEXT )
48
+ $(Q ) rm -f cext/Makefile cext/* .o $( LIBTRUFFLERUBY )
48
49
$(Q ) rm -f openssl/Makefile openssl/* .o openssl/openssl.$(DLEXT )
49
50
$(Q ) rm -f zlib/Makefile zlib/* .o zlib/zlib.$(DLEXT )
50
51
$(Q ) rm -f psych/Makefile psych/* .o psych/yaml/* .o psych/psych.$(DLEXT )
@@ -65,7 +66,7 @@ $(TRUFFLE_POSIX): truffleposix/Makefile truffleposix/truffleposix.c
65
66
cext/Makefile : cext/extconf.rb $(BASIC_EXTCONF_DEPS )
66
67
$(Q ) cd cext && $(RUBY ) extconf.rb || $(IF_EXTCONF_FAIL )
67
68
68
- cext/libtruffleruby. $( DLEXT ) : cext/Makefile cext/* .c
69
+ $( LIBTRUFFLERUBY ) : cext/Makefile cext/* .c
69
70
$(Q ) cd cext && $(MAKE )
70
71
71
72
# openssl
0 commit comments