summaryrefslogtreecommitdiff
path: root/tool/update-deps
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 03:04:10 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 03:04:10 +0000
commit8d7f9b0e380d789ca3c8be16249ed1ee1741502c (patch)
treeb8c28a958c379004408dea8412540fd7a7a5e676 /tool/update-deps
parent72de767e9b60b301cfa0648def20a5251ed9a82a (diff)
* tool/update-deps (in_makefile): Use FILES_NEED_VPATH and
FILES_CONFUSING. * ext/objspace/extconf.rb: Add VPATH for id.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/update-deps')
-rwxr-xr-xtool/update-deps48
1 files changed, 34 insertions, 14 deletions
diff --git a/tool/update-deps b/tool/update-deps
index 24c20f8..24cb7a4 100755
--- a/tool/update-deps
+++ b/tool/update-deps
@@ -196,6 +196,32 @@ def sort_paths(paths)
}
end
+# These files are not in the svn repository.
+# They are built in the build directory if the source is obtained via svn.
+# However they are exist in tarball and exist in the source directory if the source is obtained as tarball.
+FILES_NEED_VPATH = %w[
+ encdb.h
+ id.c
+ id.h
+ lex.c
+ miniprelude.c
+ newline.c
+ parse.c
+ parse.h
+ prelude.c
+ probes.h
+ transdb.h
+ verconf.h
+]
+
+# Multiple files with one filename.
+FILES_CONFUSING = %w[
+ include/ruby.h
+ include/ruby/ruby.h
+ version.h
+ include/ruby/version.h
+]
+
def in_makefile(target, source)
target = target.to_s
source = source.to_s
@@ -203,14 +229,11 @@ def in_makefile(target, source)
when %r{\A[^/]*\z}
target2 = "#{target.sub(/\.o\z/, '.$(OBJEXT)')}"
case source
- when 'newline.c', 'miniprelude.c', 'prelude.c' then source2 = source
+ when *FILES_NEED_VPATH then source2 = "{$(VPATH)}#{source}"
+ when *FILES_CONFUSING then source2 = "$(top_srcdir)/#{source}"
+ when 'revision.h' then source2 = '$(srcdir)/revision.h' # This file is always generated in $(srcdir).
when 'thread_pthread.c' then source2 = '{$(VPATH)}thread_$(THREAD_MODEL).c'
when 'thread_pthread.h' then source2 = '{$(VPATH)}thread_$(THREAD_MODEL).h'
- when 'include/ruby.h' then source2 = '$(hdrdir)/ruby.h'
- when 'include/ruby/ruby.h' then source2 = '$(hdrdir)/ruby/ruby.h'
- when 'revision.h' then source2 = '$(srcdir)/revision.h'
- when 'version.h' then source2 = '$(srcdir)/version.h'
- when 'include/ruby/version.h' then source2 = '$(srcdir)/include/ruby/version.h'
when %r{\A[^/]*\z} then source2 = "{$(VPATH)}#{File.basename source}"
when %r{\A\.ext/include/[^/]+/ruby/} then source2 = "{$(VPATH)}#{$'}"
when %r{\Ainclude/ruby/} then source2 = "{$(VPATH)}#{$'}"
@@ -224,8 +247,8 @@ def in_makefile(target, source)
when %r{\Aenc/}
target2 = "#{target.sub(/\.o\z/, '.$(OBJEXT)')}"
case source
- when 'include/ruby.h' then source2 = '$(hdrdir)/ruby.h'
- when 'include/ruby/ruby.h' then source2 = '$(hdrdir)/ruby/ruby.h'
+ when *FILES_NEED_VPATH then source2 = source
+ when *FILES_CONFUSING then source2 = "$(top_srcdir)/#{source}"
when %r{\A\.ext/include/[^/]+/ruby/} then source2 = $'
when %r{\Ainclude/ruby/} then source2 = $'
when %r{\Aenc/} then source2 = source
@@ -238,15 +261,12 @@ def in_makefile(target, source)
end
target2 = File.basename(target)
case source
- when 'include/ruby.h' then source2 = '$(top_srcdir)/include/ruby.h'
- when %r{\Ainclude/} then source2 = "$(hdrdir)/#{$'}"
+ when *FILES_NEED_VPATH then source2 = "{$(VPATH)}#{source}"
+ when *FILES_CONFUSING then source2 = "$(top_srcdir)/#{source}"
when %r{\A\.ext/include/[^/]+/ruby/} then source2 = "$(arch_hdrdir)/ruby/#{$'}"
+ when %r{\Ainclude/} then source2 = "$(hdrdir)/#{$'}"
when %r{\A#{Regexp.escape File.dirname(target)}/extconf\.h\z} then source2 = "$(RUBY_EXTCONF_H)"
when %r{\A#{Regexp.escape File.dirname(target)}/} then source2 = $'
- when 'id.h' then source2 = '$(topdir)/id.h'
- when 'parse.h' then source2 = '$(topdir)/parse.h'
- when 'lex.c' then source2 = '$(topdir)/lex.c'
- when 'probes.h' then source2 = '$(topdir)/probes.h'
else source2 = "$(top_srcdir)/#{source}"
end
["#{File.dirname(target)}/depend", target2, source2]