mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* common.mk: hide long command lines by default. verbose-mode is
turned on by V=1 as before. http://jarp.does.notwork.org/diary/200605b.html#200605121 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7ef29a9f5e
commit
f2f7a7740a
7 changed files with 99 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Nov 11 21:46:17 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* common.mk: hide long command lines by default. verbose-mode is
|
||||
turned on by V=1 as before.
|
||||
http://jarp.does.notwork.org/diary/200605b.html#200605121
|
||||
|
||||
Thu Nov 11 21:32:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/mkmf.rb (try_func): accept variable address.
|
||||
|
|
19
Makefile.in
19
Makefile.in
|
@ -153,10 +153,14 @@ all:
|
|||
|
||||
miniruby$(EXEEXT):
|
||||
@-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
|
||||
$(ECHO) linking $@
|
||||
$(Q) \
|
||||
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(LIBS) $(OUTFLAG)$@
|
||||
|
||||
$(PROGRAM):
|
||||
@$(RM) $@
|
||||
$(ECHO) linking $@
|
||||
$(Q) \
|
||||
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
|
||||
|
||||
# We must `rm' the library each time this rule is invoked because "updating" a
|
||||
|
@ -164,13 +168,18 @@ $(PROGRAM):
|
|||
# supported.
|
||||
$(LIBRUBY_A):
|
||||
@$(RM) $@
|
||||
$(ECHO) linking static-library $@
|
||||
$(Q) \
|
||||
$(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
|
||||
@-$(RANLIB) $@ 2> /dev/null || true
|
||||
|
||||
$(LIBRUBY_SO):
|
||||
@-$(PRE_LIBRUBY_UPDATE)
|
||||
$(ECHO) linking shared-library $@
|
||||
$(Q) \
|
||||
$(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
|
||||
-$(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
|
||||
-$(Q) \
|
||||
$(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
|
||||
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
|
||||
File.symlink "$(LIBRUBY_SO)", link}' \
|
||||
$(LIBRUBY_ALIASES) || true
|
||||
|
@ -265,15 +274,23 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
|
|||
fi
|
||||
|
||||
.c.@OBJEXT@:
|
||||
@$(ECHO) compiling $<
|
||||
$(Q) \
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
|
||||
|
||||
.s.@OBJEXT@:
|
||||
@$(ECHO) assembling $<
|
||||
$(Q) \
|
||||
$(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
.c.S:
|
||||
@$(ECHO) translating $<
|
||||
$(Q) \
|
||||
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
|
||||
|
||||
.c.i:
|
||||
@$(ECHO) preprocessing $<
|
||||
$(Q) \
|
||||
$(CPP) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
|
||||
|
||||
clean-local::
|
||||
|
|
25
common.mk
25
common.mk
|
@ -4,6 +4,13 @@ dll: $(LIBRUBY_SO)
|
|||
|
||||
.SUFFIXES: .inc .h .c .y .i
|
||||
|
||||
# V=0 quiet, V=1 verbose. other values don't work.
|
||||
V = 0
|
||||
Q1 = $(V:1=)
|
||||
Q = $(Q1:0=@)
|
||||
ECHO1 = $(V:1=@:)
|
||||
ECHO = $(ECHO1:0=@echo)
|
||||
|
||||
RUBYLIB = -
|
||||
RUBYOPT = -
|
||||
|
||||
|
@ -462,6 +469,8 @@ test-rubyspec: test-rubyspec-precheck
|
|||
|
||||
encs: enc trans
|
||||
encs enc trans: $(ENC_MK) $(LIBRUBY) $(PREP)
|
||||
$(ECHO) making $@
|
||||
$(Q) \
|
||||
$(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) $@
|
||||
|
||||
enc: {$(VPATH)}encdb.h
|
||||
|
@ -469,6 +478,8 @@ trans: {$(VPATH)}transdb.h
|
|||
|
||||
$(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
|
||||
$(srcdir)/lib/mkmf.rb $(RBCONFIG)
|
||||
$(ECHO) generating $@
|
||||
$(Q) \
|
||||
$(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" $@ $(ENCS)
|
||||
|
||||
.PRECIOUS: $(MKFILES)
|
||||
|
@ -722,6 +733,8 @@ EXT_SRCS = $(srcdir)/ext/ripper/ripper.c $(srcdir)/ext/json/parser/parser.c
|
|||
srcs-ext: $(EXT_SRCS)
|
||||
|
||||
srcs-enc: $(ENC_MK)
|
||||
$(ECHO) making srcs under enc
|
||||
$(Q) \
|
||||
$(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
|
||||
|
||||
incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h {$(VPATH)}known_errors.inc \
|
||||
|
@ -737,23 +750,35 @@ node_name.inc: {$(VPATH)}node.h
|
|||
$(BASERUBY) -n $(srcdir)/tool/node_name.rb < $? > $@
|
||||
|
||||
encdb.h: $(PREP) $(srcdir)/tool/generic_erb.rb $(srcdir)/template/encdb.h.tmpl
|
||||
$(ECHO) generating $@
|
||||
$(Q) \
|
||||
$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/encdb.h.tmpl $(srcdir)/enc enc
|
||||
|
||||
transdb.h: $(PREP) srcs-enc $(srcdir)/tool/generic_erb.rb $(srcdir)/template/transdb.h.tmpl
|
||||
$(ECHO) generating $@
|
||||
$(Q) \
|
||||
$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/transdb.h.tmpl $(srcdir)/enc/trans enc/trans
|
||||
|
||||
known_errors.inc: $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
|
||||
$(ECHO) generating $@
|
||||
$(Q) \
|
||||
$(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
|
||||
|
||||
miniprelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
|
||||
$(ECHO) generating $@
|
||||
$(Q) \
|
||||
$(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
|
||||
|
||||
prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) \
|
||||
$(srcdir)/lib/rubygems/defaults.rb $(srcdir)/lib/rubygems/custom_require.rb \
|
||||
$(PRELUDE_SCRIPTS) $(PREP)
|
||||
$(ECHO) generating $@
|
||||
$(Q) \
|
||||
$(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
|
||||
|
||||
golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude.rb $(srcdir)/golf_prelude.rb $(PREP)
|
||||
$(ECHO) generating $@
|
||||
$(Q) \
|
||||
$(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
|
||||
|
||||
prereq: incs srcs preludes PHONY
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
V = 0
|
||||
Q1 = $(V:1=)
|
||||
Q = $(Q1:0=@)
|
||||
ECHO1 = $(V:1=@:)
|
||||
ECHO = $(ECHO1:0=@echo)
|
||||
|
||||
encsrcdir = @srcdir@
|
||||
topdir = .
|
||||
prefix = @prefix@
|
||||
|
|
17
enc/depend
17
enc/depend
|
@ -80,6 +80,8 @@ trans: $(TRANSSOS)
|
|||
srcs: $(TRANSCSRCS)
|
||||
|
||||
<%=transvpath_prefix%>.trans<%=transvpath_prefix%>.c:
|
||||
$(ECHO) generating table from $@
|
||||
$(Q) \
|
||||
$(MINIRUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" "$<"
|
||||
|
||||
% unless encs.empty? or trans.empty?
|
||||
|
@ -104,23 +106,36 @@ $(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.
|
|||
% dependencies.each do |e|
|
||||
% obj = "enc/#{e}.$(OBJEXT)"
|
||||
% df = ("enc/#{e}.def" if deffile)
|
||||
$(ENCSODIR)/<%=e%>.$(DLEXT): <%=obj%>
|
||||
% target = e.dup
|
||||
% if target.sub!(/\Atrans\//, '$(TRANSSODIR)/')
|
||||
% mesg = "transcoder"
|
||||
% else
|
||||
% target = "$(ENCSODIR)/#{e}"
|
||||
% mesg = "encoding"
|
||||
% end
|
||||
<%=target%>.$(DLEXT): <%=obj%>
|
||||
$(ECHO) linking <%=mesg%> $(@F)
|
||||
% cmd = link_so.sub(/\$\(OBJS\)/) {obj}
|
||||
% base = File.basename(e)
|
||||
% cmd.sub!(/(?=\$\(DLDFLAGS\))/) {dldflags.sub(/\$\(TARGET\)/) {base} + " "} if dldflags
|
||||
% if df
|
||||
$(Q) \
|
||||
echo> <%=df%> EXPORTS
|
||||
$(Q) \
|
||||
echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=base%>
|
||||
% cmd.sub!(/\$\(DEFFILE\)/) {df}
|
||||
% cmd.gsub!(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}
|
||||
% end
|
||||
@$(MAKEDIRS) "$(@D)"
|
||||
$(Q) \
|
||||
<%=cmd%>
|
||||
|
||||
% end
|
||||
% dependencies.each do |e|
|
||||
<%="enc/#{e}.$(OBJEXT)"%>: <%="$(encsrcdir)/#{e}.c"%>
|
||||
-@$(MAKEDIRS) "$(@D)"
|
||||
$(ECHO) compiling <%= "#{e}.c"%>
|
||||
$(Q) \
|
||||
<%=COMPILE_C.gsub(/\$(\()?<(\:[^)]+)?(\))?/){"$(encsrcdir)/#{e}.c"}%>
|
||||
|
||||
% end
|
||||
|
|
|
@ -15,7 +15,10 @@ ripper.o: ripper.c lex.c eventids1.c eventids2.c eventids2table.c \
|
|||
$(hdrdir)/regex.h $(hdrdir)/st.h $(hdrdir)/util.h
|
||||
|
||||
.y.c:
|
||||
$(ECHO) compiling compiler $<
|
||||
$(Q) \
|
||||
$(BISON) -t -v -oy.tab.c $<
|
||||
$(Q) \
|
||||
sed -f $(top_srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@
|
||||
@$(RM) y.tab.c
|
||||
|
||||
|
@ -23,19 +26,29 @@ all: check
|
|||
static: check
|
||||
|
||||
ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y
|
||||
$(ECHO) extracting $@ from $<
|
||||
$(Q) \
|
||||
$(RUBY) $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y --output=$@
|
||||
|
||||
check: $(GEN) $(SRC1) $(SRC2)
|
||||
$(ECHO) checking $(SRC1) and $(SRC2)
|
||||
$(Q) \
|
||||
$(RUBY) $(GEN) --mode=check --ids1src=$(SRC1) --ids2src=$(SRC2)
|
||||
|
||||
eventids1.c: $(srcdir)/tools/generate.rb $(SRC1)
|
||||
$(ECHO) generating $@ from $(SRC1)
|
||||
$(Q) \
|
||||
$(RUBY) $(GEN) --mode=eventids1 --ids1src=$(SRC1) --output=$@
|
||||
|
||||
eventids2table.c: $(srcdir)/tools/generate.rb $(SRC2)
|
||||
$(ECHO) generating $@ from $(SRC2)
|
||||
$(Q) \
|
||||
$(RUBY) $(GEN) --mode=eventids2table --ids2src=$(SRC2) --output=$@
|
||||
|
||||
# Entries for Ripper maintainer
|
||||
|
||||
preproc: ripper.E
|
||||
ripper.E: ripper.c
|
||||
$(ECHO) preprocessing $<
|
||||
$(Q) \
|
||||
$(CC) -E $(CPPFLAGS) ripper.c | $(RUBY) $(srcdir)/tools/strip.rb > $@
|
||||
|
|
19
lib/mkmf.rb
19
lib/mkmf.rb
|
@ -1543,6 +1543,13 @@ def configuration(srcdir)
|
|||
mk << %{
|
||||
SHELL = /bin/sh
|
||||
|
||||
# V=0 quiet, V=1 verbose. other values don't work.
|
||||
V = 0
|
||||
Q1 = $(V:1=)
|
||||
Q = $(Q1:0=@)
|
||||
ECHO1 = $(V:1=@:)
|
||||
ECHO = $(ECHO1:0=@echo)
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
#{"top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/") if $extmk}
|
||||
srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2])}.quote}
|
||||
|
@ -1955,22 +1962,23 @@ site-install-rb: install-rb
|
|||
mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
|
||||
mfile.print "\n"
|
||||
|
||||
compile_command = "\n\t$(ECHO) compiling $<\n\t$(Q) %s\n\n"
|
||||
CXX_EXT.each do |e|
|
||||
COMPILE_RULES.each do |rule|
|
||||
mfile.printf(rule, e, $OBJEXT)
|
||||
mfile.printf("\n\t%s\n\n", COMPILE_CXX)
|
||||
mfile.printf(compile_command, COMPILE_CXX)
|
||||
end
|
||||
end
|
||||
%w[c].each do |e|
|
||||
COMPILE_RULES.each do |rule|
|
||||
mfile.printf(rule, e, $OBJEXT)
|
||||
mfile.printf("\n\t%s\n\n", COMPILE_C)
|
||||
mfile.printf(compile_command, COMPILE_C)
|
||||
end
|
||||
end
|
||||
%w[m].each do |e|
|
||||
COMPILE_RULES.each do |rule|
|
||||
mfile.printf(rule, e, $OBJEXT)
|
||||
mfile.printf("\n\t%s\n\n", COMPILE_OBJC)
|
||||
mfile.printf(compile_command, COMPILE_OBJC)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1978,15 +1986,17 @@ site-install-rb: install-rb
|
|||
mfile.print "$(DLLIB): "
|
||||
mfile.print "$(DEFFILE) " if makedef
|
||||
mfile.print "$(OBJS) Makefile\n"
|
||||
mfile.print "\t$(ECHO) linking shared-object #{target_prefix.sub(/\A\/(.*)/, '\1/')}$(DLLIB)\n"
|
||||
mfile.print "\t@-$(RM) $(@#{sep})\n"
|
||||
mfile.print "\t@-$(MAKEDIRS) $(@D)\n" if $extout
|
||||
link_so = LINK_SO.gsub(/^/, "\t")
|
||||
link_so = LINK_SO.gsub(/^/, "\t$(Q) ")
|
||||
if srcs.any?(&%r"\.(?:#{CXX_EXT.join('|')})\z".method(:===))
|
||||
link_so = link_so.sub(/\bLDSHARED\b/, '\&XX')
|
||||
end
|
||||
mfile.print link_so, "\n\n"
|
||||
unless $static.nil?
|
||||
mfile.print "$(STATIC_LIB): $(OBJS)\n\t@-$(RM) $(@#{sep})\n\t"
|
||||
mfile.print "$(ECHO) linking static-library $(@)\n\t$(Q) "
|
||||
mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
|
||||
config_string('RANLIB') do |ranlib|
|
||||
mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
|
||||
|
@ -1995,6 +2005,7 @@ site-install-rb: install-rb
|
|||
mfile.print "\n\n"
|
||||
if makedef
|
||||
mfile.print "$(DEFFILE): #{origdef}\n"
|
||||
mfile.print "\t$(ECHO) generating $@\n\t$(Q) \\"
|
||||
mfile.print "\t$(RUBY) #{makedef} #{origdef} > $@\n\n"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue