From be0037833fded90cf4de7953d466e93a2085eb67 Mon Sep 17 00:00:00 2001 From: heister Date: Tue, 17 Jan 2012 14:42:30 +0000 Subject: [PATCH] fix make_dependencies for .inst files git-svn-id: https://svn.dealii.org/trunk@24905 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/scripts/make_dependencies.cc | 22 ++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/deal.II/common/scripts/make_dependencies.cc b/deal.II/common/scripts/make_dependencies.cc index e17b8a9d9a..7f105ea77b 100644 --- a/deal.II/common/scripts/make_dependencies.cc +++ b/deal.II/common/scripts/make_dependencies.cc @@ -184,11 +184,25 @@ void determine_direct_includes (const std::string &file) std::abort(); } - // next try to locate the file in + + bool is_inst_file = + included_file.size()>5 + && (included_file.rfind(".inst") == (included_file.size()-5)); + + // .inst files are always relative to + // the current path. We need a special + // case, because they might not exist + // at this point and the next block + // checks the files for existence. + if (is_inst_file) + included_file = present_path+included_file; + + + // next try to locate the file in // absolute paths. For includes of the // form #include "...", we check the - // current path first. - if (included_file[0] != '/') + // current path first. + if (included_file[0] != '/' && !is_inst_file) { bool is_relative_path = false; if (line[pos] == '"' && file_exists(present_path+included_file)) @@ -219,8 +233,6 @@ void determine_direct_includes (const std::string &file) // it will be generated by make // later, so we better keep it // on the list. - bool is_inst_file = - included_file.size()>5 && (included_file.rfind(".inst") == (included_file.size()-5)); if (line[pos] != '"' || !is_inst_file) { -- 2.39.5