Skip to content

Commit

Permalink
common.mk: fix conflict of version.i
Browse files Browse the repository at this point in the history
* common.mk ($(arch)-fake.rb): read from STDIN instead of creating
  version.i, to get rid of conflict with tool/update-deps.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jul 29, 2015
1 parent c02ffd9 commit 53e301a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ y.tab.c
/uncommon.mk
/verconf.h
/verconf.mk
/version.i
/web
/yasmdata.rb

Expand Down
13 changes: 6 additions & 7 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,13 @@ fake: $(CROSS_COMPILING)-fake
yes-fake: $(arch)-fake.rb $(RBCONFIG) PHONY

This comment has been minimized.

Copy link
@yaya134679
no-fake -fake: PHONY

$(arch)-fake.rb: $(srcdir)/template/fake.rb.in $(srcdir)/tool/generic_erb.rb version.i
$(ECHO) generating $@
$(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -c -o $@ "$(srcdir)/template/fake.rb.in" \
i=version.i srcdir="$(srcdir)" BASERUBY="$(BASERUBY)"

# .i really doesn't depend on .o, just ensure newer than headers which
# really doesn't depend on .o, just ensure newer than headers which
# version.o depends on.
version.i: version.$(OBJEXT)
$(arch)-fake.rb: $(srcdir)/template/fake.rb.in $(srcdir)/tool/generic_erb.rb version.$(OBJEXT)
$(ECHO) generating $@
$(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) "$(srcdir)/version.c" | \
$(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ "$(srcdir)/template/fake.rb.in" \
i=- srcdir="$(srcdir)" BASERUBY="$(BASERUBY)"

btest: $(TEST_RUNNABLE)-btest
no-btest: PHONY
Expand Down
4 changes: 2 additions & 2 deletions template/fake.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ while /\A(\w+)=(.*)/ =~ ARGV[0]
arg[$1].tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
ARGV.shift
end
if arg['i']
src = File.read(arg['i'])
if inc = arg['i']
src = inc == '-' ? STDIN.read : File.read(inc)
arg['versions'] = version = {}
File.read(File.join(arg['srcdir'], 'version.c')).
scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|STR)\(([^()]*)\)/m) do |n, v|
Expand Down

0 comments on commit 53e301a

Please sign in to comment.