#include <errno.h>#include <stdio.h>#include <unistd.h>#include "cmt_use.h"#include "cmt_fragment.h"#include "cmt_symbol.h"#include "cmt_system.h"#include "cmt.h"#include "cmt_deps_builder.h"#include "cmt_generator.h"#include "cmt_constituent.h"#include "cmt_language.h"#include "cmt_awk.h"Include dependency graph for cmt_generator.cxx:

Go to the source code of this file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 2359 of file cmt_generator.cxx. Referenced by Generator::build_dependencies(). 02360 {
02361 static const cmt_string empty;
02362
02363 int pos = line.find (" = ");
02364 if (pos != cmt_string::npos)
02365 {
02366 static cmt_string key;
02367 line.substr (0, pos + 3, key);
02368 pos = text.find (key);
02369 if (pos != cmt_string::npos)
02370 {
02371 // The key in line exists in text.
02372 // Now check if the key is exactly the same.
02373
02374 if ((pos == 0) || (text[pos -1] == '\n'))
02375 {
02376 // The key is either in the first line or
02377 // exactly matches '^key = ...'
02378
02379 int nl = text.find (pos, "\n");
02380 if (nl != cmt_string::npos)
02381 {
02382 static cmt_string old;
02383 text.substr (pos, nl - pos + 1, old);
02384 text.replace (old, empty);
02385 }
02386 else
02387 {
02388 text.erase (pos);
02389 }
02390 }
02391 }
02392 }
02393 if (line != "")
02394 {
02395 text += line;
02396 text += "\n";
02397 }
02398 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 223 of file cmt_generator.cxx. Referenced by MakefileGenerator::analyze_document_file(), Generator::build_dependencies(), MakefileGenerator::build_document_makefile(), MakefileGenerator::build_library_makefile(), MakefileGenerator::module_file_action(), and MakefileGenerator::proto_file_action(). 00224 {
00225 static CmtSystem::cmt_string_vector ps;
00226
00227 CmtSystem::split (text, " ", ps);
00228
00229 text = "";
00230
00231 for (int i = 0; i < ps.size (); i++)
00232 {
00233 cmt_string& s = ps[i];
00234
00235 CmtSystem::compress_path (s);
00236
00237 //cout << " filter_paths " << s << endl;
00238
00239 if (i > 0) text += " ";
00240 text += s;
00241 }
00242
00243 text.replace_all ("./../src/", "$(src)");
00244 text.replace_all (".\\..\\src\\", "$(src)");
00245 text.replace_all ("../src/", "$(src)");
00246 text.replace_all ("..\\src\\", "$(src)");
00247 text.replace_all ("../doc/", "$(doc)");
00248 text.replace_all ("..\\doc\\", "$(doc)");
00249 text.replace_all ("$(src)$(src)", "$(src)");
00250 }
|
|
|
Definition at line 252 of file cmt_generator.cxx. Referenced by Generator::build_dependencies(), MakefileGenerator::build_document_makefile(), MakefileGenerator::build_library_makefile(), and Generator::build_msdev(). 00254 {
00255 static cmt_string suffix;
00256 static cmt_string name;
00257
00258 suffix = "";
00259 name = "";
00260
00261 files.clear ();
00262
00263 CmtSystem::get_dot_suffix (full_name, suffix);
00264
00265 if (full_name.find ('*') != cmt_string::npos)
00266 {
00267 CmtSystem::scan_dir (full_name, files);
00268
00269 if (Cmt::get_debug ())
00270 {
00271 cout << "CMT> full_name=" << full_name <<
00272 " pwd=" << CmtSystem::pwd () << endl;
00273 cout << "CMT> files.size=" << files.size () << endl;
00274 }
00275
00276 for (int j = 0; j < files.size (); j++)
00277 {
00278 cmt_string& n = files[j];
00279 static cmt_string s;
00280
00281 CmtSystem::get_dot_suffix (n, s);
00282 if (s != suffix)
00283 {
00284 n = "";
00285 }
00286 }
00287 }
00288 else
00289 {
00290 cmt_string& n = files.add ();
00291
00292 n = full_name;
00293 }
00294 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 151 of file cmt_generator.cxx. |
1.2.3 written by Dimitri van Heesch,
© 1997-2000