diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-08 01:38:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-08 01:38:32 +0000 |
commit | c88c049ed1fcebe137400980cf4c14c8075bcff8 (patch) | |
tree | 602d73d0a1eb3ff2da5d37419908f18c354f3d7f /lib | |
parent | 6041af45a36fb2f8b0a1c8c89825d1ec88833883 (diff) | |
download | ruby-c88c049ed1fcebe137400980cf4c14c8075bcff8.tar.gz |
mkmf.rb: translate to assembler
* lib/mkmf.rb (create_makefile): add rules to translate to
assembler sources.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 2a83189e30..cb66d88ccc 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2358,20 +2358,28 @@ site-install-rb: install-rb return unless target mfile.puts SRC_EXT.collect {|e| ".path.#{e} = $(VPATH)"} if $nmake == ?b - mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n" + mfile.print ".SUFFIXES: .#{(SRC_EXT + [$OBJEXT, $ASMEXT]).compact.join(' .')}\n" mfile.print "\n" compile_command = "\n\t$(ECHO) compiling $(<#{rsep})\n\t$(Q) %s\n\n" + command = compile_command % COMPILE_CXX + asm_command = compile_command.sub(/compiling/, 'translating') % ASSEMBLE_CXX CXX_EXT.each do |e| each_compile_rules do |rule| mfile.printf(rule, e, $OBJEXT) - mfile.printf(compile_command, COMPILE_CXX) + mfile.print(command) + mfile.printf(rule, e, $ASMEXT) + mfile.print(asm_command) end end + command = compile_command % COMPILE_C + asm_command = compile_command.sub(/compiling/, 'translating') % ASSEMBLE_C C_EXT.each do |e| each_compile_rules do |rule| mfile.printf(rule, e, $OBJEXT) - mfile.printf(compile_command, COMPILE_C) + mfile.print(command) + mfile.printf(rule, e, $ASMEXT) + mfile.print(asm_command) end end @@ -2444,6 +2452,7 @@ site-install-rb: install-rb $LIBEXT = config['LIBEXT'].dup $OBJEXT = config["OBJEXT"].dup $EXEEXT = config["EXEEXT"].dup + $ASMEXT = config_string('ASMEXT', &:dup) || 'S' $LIBS = "#{config['LIBS']} #{config['DLDLIBS']}" $LIBRUBYARG = "" $LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC'] @@ -2592,6 +2601,16 @@ MESSAGE COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<' ## + # Command which will translate C files to assembler sources in the generated Makefile + + ASSEMBLE_C = config_string('ASSEMBLE_C') || COMPILE_C.sub(/(?<=\s)-c(?=\s)/, '-S') + + ## + # Command which will translate C++ files to assembler sources in the generated Makefile + + ASSEMBLE_CXX = config_string('ASSEMBLE_CXX') || COMPILE_CXX.sub(/(?<=\s)-c(?=\s)/, '-S') + + ## # Command which will compile a program in order to test linking a library TRY_LINK = config_string('TRY_LINK') || |