* lib/mkmf.rb (create_makefile): add dependency to header files when

depend files don't exist.  now we can remove simple (and often
  wrong) depend files in most cases.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2012-08-23 07:15:27 +00:00
Родитель 3721fb0106
Коммит ce5af582a0
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Thu Aug 23 16:12:40 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/mkmf.rb (create_makefile): add dependency to header files when
depend files don't exist. now we can remove simple (and often
wrong) depend files in most cases.
Thu Aug 23 16:02:20 2012 Koichi Sasada <ko1@atdot.net> Thu Aug 23 16:02:20 2012 Koichi Sasada <ko1@atdot.net>
* ext/date/depend: add dependency to $(ruby_headers). * ext/date/depend: add dependency to $(ruby_headers).

Просмотреть файл

@ -50,6 +50,7 @@ module MakeMakefile
CXX_EXT.concat(%w[C]) CXX_EXT.concat(%w[C])
end end
SRC_EXT = C_EXT + CXX_EXT SRC_EXT = C_EXT + CXX_EXT
HDR_EXT = %w[h hpp]
$static = nil $static = nil
$config_h = '$(arch_hdrdir)/ruby/config.h' $config_h = '$(arch_hdrdir)/ruby/config.h'
$default_static = $static $default_static = $static
@ -2016,6 +2017,8 @@ RULES
end end
$srcs = srcs $srcs = srcs
hdrs = Dir[File.join(srcdir, "*.{#{HDR_EXT.join(%q{,})}}")]
target = nil if $objs.empty? target = nil if $objs.empty?
if target and EXPORT_PREFIX if target and EXPORT_PREFIX
@ -2069,6 +2072,7 @@ LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')} SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
OBJS = #{$objs.join(" ")} OBJS = #{$objs.join(" ")}
HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
TARGET = #{target} TARGET = #{target}
TARGET_NAME = #{target && target[/\A\w+/]} TARGET_NAME = #{target && target[/\A\w+/]}
TARGET_ENTRY = #{EXPORT_PREFIX || ''}Init_$(TARGET_NAME) TARGET_ENTRY = #{EXPORT_PREFIX || ''}Init_$(TARGET_NAME)
@ -2228,7 +2232,7 @@ site-install-rb: install-rb
if File.exist?(depend) if File.exist?(depend)
mfile.print("###\n", *depend_rules(File.read(depend))) mfile.print("###\n", *depend_rules(File.read(depend)))
else else
mfile.print "$(OBJS): $(ruby_headers)\n" mfile.print "$(OBJS): $(HDRS) $(ruby_headers)\n"
end end
$makefile_created = true $makefile_created = true