From f7ef047f8e3e271e8defa0065959416a188a8fd4 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 14 Jul 2017 10:31:05 +0000 Subject: [PATCH] VPATH for ripper * common.mk (ripper.c): pass the build directory path for id.h which may be generated there. * ext/ripper/depend (ripper.y): search the top build directory and the top source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- common.mk | 4 ++-- ext/ripper/depend | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index 01eaba2fc8..792d62cbf5 100644 --- a/common.mk +++ b/common.mk @@ -977,10 +977,10 @@ $(REVISION_H): $(srcdir)/version.h $(srcdir)/tool/file2lastrev.rb $(REVISION_FOR $(srcdir)/ext/ripper/ripper.c: $(srcdir)/parse.y id.h $(ECHO) generating $@ - $(Q) $(CHDIR) $(@D) && \ + $(Q) VPATH=$${PWD-`pwd`} && $(CHDIR) $(@D) && \ sed /AUTOGENERATED/q depend | \ $(exec) $(MAKE) -f - $(mflags) \ - Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH=../.. \ + Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$${VPATH}" \ RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)" $(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl diff --git a/ext/ripper/depend b/ext/ripper/depend index d4f0a449d5..5d3bce4ec3 100644 --- a/ext/ripper/depend +++ b/ext/ripper/depend @@ -20,7 +20,8 @@ static: check ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y $(ECHO) extracting $@ from $(top_srcdir)/parse.y - $(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ --vpath=$(VPATH) id.h $(top_srcdir)/parse.y > ripper.tmp.y + $(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ \ + --vpath=$(VPATH)$(PATH_SEPARATOR)$(top_srcdir) id.h $(top_srcdir)/parse.y > ripper.tmp.y $(Q) $(RUBY) $(srcdir)/tools/preproc.rb ripper.tmp.y --output=$@ $(Q) $(RM) ripper.tmp.y