From: wolf Date: Fri, 26 Sep 2003 15:03:07 +0000 (+0000) Subject: Handle no-base better. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f60cdfd7b970abbe5ecfc41dbf5c35903f0aafb;p=dealii-svn.git Handle no-base better. git-svn-id: https://svn.dealii.org/trunk@8038 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/scripts/make_dependencies.cc b/deal.II/common/scripts/make_dependencies.cc index 3a00e2de18..cd7fb97790 100644 --- a/deal.II/common/scripts/make_dependencies.cc +++ b/deal.II/common/scripts/make_dependencies.cc @@ -27,7 +27,8 @@ // $basepath/.o-file $basepath/.g.o-file: file included_files // // $basepath is the dir where the object files are to be placed (as -// given by the -B parameter to this script) +// given by the -B parameter to this script). if no path is given, no +// path is printed. if one is given, a slash is appended if necessary // Author: Wolfgang Bangerth, 2003 (and based on a previous perl // script written 1998, 1999, 2000, 2001, 2002) @@ -41,7 +42,9 @@ #include #include - // base path for object files + // base path for object files, + // including trailing slash if + // non-empty std::string basepath; // list of include directories @@ -354,7 +357,11 @@ int main (int argc, char **argv) // then this is the base name // for object files else if ((arg.length()>2) && (arg[0]=='-') && (arg[1]=='B')) - basepath = std::string(arg.begin()+2, arg.end()); + { + basepath = std::string(arg.begin()+2, arg.end()); + if (basepath[basepath.size()-1] != '/') + basepath += '/'; + } // otherwise assume that this // is one of the files for @@ -411,7 +418,7 @@ int main (int argc, char **argv) // ...write the rule for the .o // file... - std::cout << basepath << "/" << basename << ".o: \\" + std::cout << basepath << basename << ".o: \\" << std::endl << "\t\t" << *file; for (std::set::const_iterator i=includes.begin(); @@ -421,7 +428,7 @@ int main (int argc, char **argv) // ...and a similar rule for // the .g.o file - std::cout << basepath << "/" << basename << ".g.o: \\" + std::cout << basepath << basename << ".g.o: \\" << std::endl << "\t\t" << *file; for (std::set::const_iterator i=includes.begin();