Unverified Commit cee916ab authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #5311 from shuujii/change-.o.d-back-to-.d-because-.pi.d-is-no-longer-created

Change `.o.d` back to `.d` because `.pi.d` is no longer created
parents 02e336ee d90abc64
...@@ -24,7 +24,7 @@ MRuby::Build.new do |conf| ...@@ -24,7 +24,7 @@ MRuby::Build.new do |conf|
# cc.defines = %w() # cc.defines = %w()
# cc.option_include_path = %q[-I"%s"] # cc.option_include_path = %q[-I"%s"]
# cc.option_define = '-D%s' # cc.option_define = '-D%s'
# cc.compile_options = %Q[%{flags} -MMD -MF "%{outfile}".d -o "%{outfile}" -c "%{infile}"] # cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
# end # end
# mrbc settings # mrbc settings
......
...@@ -87,7 +87,7 @@ module MRuby ...@@ -87,7 +87,7 @@ module MRuby
def run(outfile, infile, _defines=[], _include_paths=[], _flags=[]) def run(outfile, infile, _defines=[], _include_paths=[], _flags=[])
mkdir_p File.dirname(outfile) mkdir_p File.dirname(outfile)
flags = all_flags(_defines, _include_paths, _flags) flags = all_flags(_defines, _include_paths, _flags)
if File.extname(outfile) == build.exts.object if object_ext?(outfile)
label = @label label = @label
opts = compile_options opts = compile_options
else else
...@@ -157,8 +157,8 @@ module MRuby ...@@ -157,8 +157,8 @@ module MRuby
# /src/value_array.h: # /src/value_array.h:
# #
def get_dependencies(file) def get_dependencies(file)
dep_file = "#{file}.d" dep_file = file.ext(".d")
return [MRUBY_CONFIG] unless File.exist?(dep_file) return [MRUBY_CONFIG] unless object_ext?(file) && File.exist?(dep_file)
deps = File.read(dep_file).gsub("\\\n ", "").split("\n").map do |dep_line| deps = File.read(dep_file).gsub("\\\n ", "").split("\n").map do |dep_line|
# dep_line: # dep_line:
...@@ -172,6 +172,10 @@ module MRuby ...@@ -172,6 +172,10 @@ module MRuby
end.flatten.uniq end.flatten.uniq
deps << MRUBY_CONFIG deps << MRUBY_CONFIG
end end
def object_ext?(path)
File.extname(path) == build.exts.object
end
end end
class Command::Linker < Command class Command::Linker < Command
......
...@@ -15,7 +15,7 @@ MRuby::Toolchain.new(:gcc) do |conf, params| ...@@ -15,7 +15,7 @@ MRuby::Toolchain.new(:gcc) do |conf, params|
end end
compiler.option_include_path = %q[-I"%s"] compiler.option_include_path = %q[-I"%s"]
compiler.option_define = '-D%s' compiler.option_define = '-D%s'
compiler.compile_options = %|-MMD -MF "%{outfile}.d" -c #{compile_opt}| compiler.compile_options = "-MMD -c #{compile_opt}"
compiler.preprocess_options = "-E -P #{compile_opt}" compiler.preprocess_options = "-E -P #{compile_opt}"
compiler.cxx_compile_flag = '-x c++ -std=gnu++03' compiler.cxx_compile_flag = '-x c++ -std=gnu++03'
compiler.cxx_exception_flag = '-fexceptions' compiler.cxx_exception_flag = '-fexceptions'
......
...@@ -11,7 +11,7 @@ MRuby::Toolchain.new(:openwrt) do |conf| ...@@ -11,7 +11,7 @@ MRuby::Toolchain.new(:openwrt) do |conf|
end end
cc.option_include_path = %q[-I"%s"] cc.option_include_path = %q[-I"%s"]
cc.option_define = '-D%s' cc.option_define = '-D%s'
cc.compile_options = '%{flags} -MMD -MF "%{outfile}.d" -o "%{outfile}" -c "%{infile}"' cc.compile_options = '%{flags} -MMD -o "%{outfile}" -c "%{infile}"'
cc.preprocess_options = '%{flags} -o "%{outfile}" -E -P "%{infile}"' cc.preprocess_options = '%{flags} -o "%{outfile}" -E -P "%{infile}"'
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment