cmMakefile.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #include "cmMakefile.h"
  12. #include "cmCommand.h"
  13. #include "cmStandardIncludes.h"
  14. #include "cmClassFile.h"
  15. #include "cmDirectory.h"
  16. #include "cmSystemTools.h"
  17. #include "cmMakefileGenerator.h"
  18. #include "cmCommands.h"
  19. #include "cmCacheManager.h"
  20. // default is not to be building executables
  21. cmMakefile::cmMakefile()
  22. {
  23. // Setup the default include file regular expression.
  24. // Should be changed to something like "\\.(h|hh|hpp|hxx)$" or "^.*$"
  25. m_IncludeFileRegularExpression = "^itk|^vtk|^vnl|^vcl|^f2c";
  26. m_DefineFlags = " ";
  27. m_MakefileGenerator = 0;
  28. this->AddSourceGroup("", "^.*$");
  29. this->AddSourceGroup("Source Files", "\\.(cpp|C|c|cxx|rc|def|r|odl|idl|hpj|bat)$");
  30. this->AddSourceGroup("Header Files", "\\.(h|hh|hpp|hxx|hm|inl)$");
  31. this->AddDefaultCommands();
  32. this->AddDefaultDefinitions();
  33. }
  34. void cmMakefile::AddDefaultCommands()
  35. {
  36. std::list<cmCommand*> commands;
  37. GetPredefinedCommands(commands);
  38. for(std::list<cmCommand*>::iterator i = commands.begin();
  39. i != commands.end(); ++i)
  40. {
  41. this->AddCommand(*i);
  42. }
  43. #ifdef _WIN32
  44. this->AddDefinition("WIN32", "1");
  45. #else
  46. this->AddDefinition("UNIX", "1");
  47. #endif
  48. // Cygwin is more like unix so enable the unix commands
  49. #if defined(__CYGWIN__)
  50. this->AddDefinition("UNIX", "1");
  51. #endif
  52. }
  53. cmMakefile::~cmMakefile()
  54. {
  55. for(unsigned int i=0; i < m_UsedCommands.size(); i++)
  56. {
  57. delete m_UsedCommands[i];
  58. }
  59. for(RegisteredCommandsMap::iterator j = m_Commands.begin();
  60. j != m_Commands.end(); ++j)
  61. {
  62. delete (*j).second;
  63. }
  64. delete m_MakefileGenerator;
  65. }
  66. void cmMakefile::PrintStringVector(const char* s, std::vector<std::string>& v)
  67. {
  68. std::cout << s << ": ( \n";
  69. for(std::vector<std::string>::iterator i = v.begin();
  70. i != v.end(); ++i)
  71. {
  72. std::cout << (*i).c_str() << " ";
  73. }
  74. std::cout << " )\n";
  75. }
  76. // call print on all the classes in the makefile
  77. void cmMakefile::Print()
  78. {
  79. // print the class lists
  80. std::cout << "classes:\n";
  81. for(ClassMap::const_iterator l = m_Classes.begin();
  82. l != m_Classes.end(); l++)
  83. {
  84. std::cout << " Class list named: " << l->first << std::endl;
  85. for(std::vector<cmClassFile>::const_iterator i = l->second.begin();
  86. i != l->second.end(); i++)
  87. {
  88. i->Print();
  89. }
  90. }
  91. std::cout << " m_Targets: ";
  92. for (cmTargets::const_iterator l = m_Targets.begin();
  93. l != m_Targets.end(); l++)
  94. {
  95. std::cout << l->first << std::endl;
  96. }
  97. std::cout << " m_CurrentOutputDirectory; " <<
  98. m_CurrentOutputDirectory.c_str() << std::endl;
  99. std::cout << " m_StartOutputDirectory; " <<
  100. m_StartOutputDirectory.c_str() << std::endl;
  101. std::cout << " m_HomeOutputDirectory; " <<
  102. m_HomeOutputDirectory.c_str() << std::endl;
  103. std::cout << " m_cmCurrentDirectory; " <<
  104. m_cmCurrentDirectory.c_str() << std::endl;
  105. std::cout << " m_cmStartDirectory; " <<
  106. m_cmStartDirectory.c_str() << std::endl;
  107. std::cout << " m_cmHomeDirectory; " <<
  108. m_cmHomeDirectory.c_str() << std::endl;
  109. std::cout << " m_ProjectName; " << m_ProjectName.c_str() << std::endl;
  110. this->PrintStringVector("m_SubDirectories ", m_SubDirectories);
  111. this->PrintStringVector("m_MakeVerbatim ", m_MakeVerbatim);
  112. this->PrintStringVector("m_IncludeDirectories;", m_IncludeDirectories);
  113. this->PrintStringVector("m_LinkDirectories", m_LinkDirectories);
  114. this->PrintStringVector("m_LinkLibraries", m_LinkLibraries);
  115. this->PrintStringVector("m_LinkLibrariesWin32", m_LinkLibrariesWin32);
  116. this->PrintStringVector("m_LinkLibrariesUnix", m_LinkLibrariesUnix);
  117. this->PrintStringVector("m_Utilities", m_Utilities);
  118. this->PrintStringVector("m_UtilityDirectories", m_UtilityDirectories);
  119. }
  120. // Parse the given CMakeLists.txt file into a list of classes.
  121. // Reads in current CMakeLists file and all parent CMakeLists files
  122. // executing all inherited commands in the parents
  123. bool cmMakefile::ReadListFile(const char* filename)
  124. {
  125. // is there a parent CMakeLists file that does not go beyond the
  126. // Home directory? if so recurse and read in that List file
  127. std::string parentList = this->GetParentListFileName(filename);
  128. if (parentList != "")
  129. {
  130. // save the current directory
  131. std::string srcdir = m_cmCurrentDirectory;
  132. std::string bindir = m_CurrentOutputDirectory;
  133. // compute the new current directories
  134. std::string::size_type pos = m_cmCurrentDirectory.rfind('/');
  135. if(pos != std::string::npos)
  136. {
  137. m_cmCurrentDirectory = m_cmCurrentDirectory.substr(0, pos);
  138. }
  139. pos = m_CurrentOutputDirectory.rfind('/');
  140. if(pos != std::string::npos)
  141. {
  142. m_CurrentOutputDirectory = m_CurrentOutputDirectory.substr(0, pos);
  143. }
  144. this->ReadListFile(parentList.c_str());
  145. // restore the current directory
  146. m_cmCurrentDirectory = srcdir;
  147. m_CurrentOutputDirectory = bindir;
  148. }
  149. // are we at the start CMakeLists file or are we processing a parent
  150. // lists file
  151. bool inheriting = (m_cmCurrentDirectory != m_cmStartDirectory);
  152. // Now read the input file
  153. std::ifstream fin(filename);
  154. if(!fin)
  155. {
  156. cmSystemTools::Error("error can not open file ", filename);
  157. return false;
  158. }
  159. std::string name;
  160. std::vector<std::string> arguments;
  161. while ( fin )
  162. {
  163. if(cmSystemTools::ParseFunction(fin, name, arguments) )
  164. {
  165. // Special command that needs to be removed when
  166. // ADD_COMMAND is implemented
  167. if(name == "VERBATIM")
  168. {
  169. if (!inheriting)
  170. {
  171. m_MakeVerbatim = arguments;
  172. }
  173. }
  174. else
  175. {
  176. RegisteredCommandsMap::iterator pos = m_Commands.find(name);
  177. if(pos != m_Commands.end())
  178. {
  179. cmCommand* rm = (*pos).second;
  180. cmCommand* usedCommand = rm->Clone();
  181. usedCommand->SetMakefile(this);
  182. bool keepCommand = false;
  183. if(usedCommand->GetEnabled())
  184. {
  185. // if not running in inherit mode or
  186. // if the command is inherited then Invoke it.
  187. if(!inheriting || usedCommand->IsInherited())
  188. {
  189. if(!usedCommand->Invoke(arguments))
  190. {
  191. cmSystemTools::Error(usedCommand->GetName(),
  192. ": Error : \n",
  193. usedCommand->GetError(),
  194. m_cmCurrentDirectory.c_str());
  195. }
  196. else
  197. {
  198. // use the command
  199. keepCommand = true;
  200. m_UsedCommands.push_back(usedCommand);
  201. }
  202. }
  203. }
  204. // if the Cloned command was not used
  205. // then delete it
  206. if(!keepCommand)
  207. {
  208. delete usedCommand;
  209. }
  210. }
  211. else
  212. {
  213. cmSystemTools::Error("unknown CMake command ", name.c_str());
  214. }
  215. }
  216. }
  217. }
  218. return true;
  219. }
  220. cmClassFile *cmMakefile::GetClass(const char *srclist, const char *cname)
  221. {
  222. ClassMap::iterator sl = m_Classes.find(srclist);
  223. // find the src list
  224. if (sl == m_Classes.end())
  225. {
  226. return 0;
  227. }
  228. // find the class
  229. for (std::vector<cmClassFile>::iterator i = sl->second.begin();
  230. i != sl->second.end(); ++i)
  231. {
  232. if (i->m_ClassName == cname)
  233. {
  234. return &(*i);
  235. }
  236. }
  237. return 0;
  238. }
  239. void cmMakefile::AddCommand(cmCommand* wg)
  240. {
  241. std::string name = wg->GetName();
  242. m_Commands.insert( RegisteredCommandsMap::value_type(name, wg));
  243. }
  244. // Set the make file
  245. void cmMakefile::SetMakefileGenerator(cmMakefileGenerator* mf)
  246. {
  247. delete m_MakefileGenerator;
  248. m_MakefileGenerator = mf;
  249. }
  250. // Generate the output file
  251. void cmMakefile::GenerateMakefile()
  252. {
  253. // do all the variable expansions here
  254. this->ExpandVariables();
  255. // set the makefile on the generator
  256. m_MakefileGenerator->SetMakefile(this);
  257. // give all the commands a chance to do something
  258. // after the file has been parsed before generation
  259. for(std::vector<cmCommand*>::iterator i = m_UsedCommands.begin();
  260. i != m_UsedCommands.end(); ++i)
  261. {
  262. (*i)->FinalPass();
  263. }
  264. // now do the generation
  265. m_MakefileGenerator->GenerateMakefile();
  266. }
  267. void cmMakefile::AddClass(cmClassFile& cmfile, const char *srclist)
  268. {
  269. m_Classes[srclist].push_back(cmfile);
  270. }
  271. void cmMakefile::AddCustomCommand(const char* source,
  272. const char* command,
  273. const std::vector<std::string>& depends,
  274. const std::vector<std::string>& outputs,
  275. const char *target)
  276. {
  277. // find the target,
  278. if (m_Targets.find(target) != m_Targets.end())
  279. {
  280. cmCustomCommand cc(source,command,depends,outputs);
  281. m_Targets[target].m_CustomCommands.push_back(cc);
  282. }
  283. }
  284. void cmMakefile::AddCustomCommand(const char* source,
  285. const char* command,
  286. const std::vector<std::string>& depends,
  287. const char* output,
  288. const char *target)
  289. {
  290. std::vector<std::string> outputs;
  291. outputs.push_back(output);
  292. this->AddCustomCommand(source, command, depends, outputs, target);
  293. }
  294. void cmMakefile::AddDefineFlag(const char* flag)
  295. {
  296. m_DefineFlags += " ";
  297. m_DefineFlags += flag;
  298. }
  299. void cmMakefile::AddUtility(const char* util)
  300. {
  301. m_Utilities.push_back(util);
  302. }
  303. void cmMakefile::AddUtilityDirectory(const char* dir)
  304. {
  305. m_UtilityDirectories.push_back(dir);
  306. }
  307. void cmMakefile::AddLinkLibrary(const char* lib)
  308. {
  309. m_LinkLibraries.push_back(lib);
  310. }
  311. void cmMakefile::AddLinkDirectory(const char* dir)
  312. {
  313. m_LinkDirectories.push_back(dir);
  314. }
  315. void cmMakefile::AddSubDirectory(const char* sub)
  316. {
  317. m_SubDirectories.push_back(sub);
  318. }
  319. void cmMakefile::AddIncludeDirectory(const char* inc)
  320. {
  321. m_IncludeDirectories.push_back(inc);
  322. }
  323. void cmMakefile::AddDefinition(const char* name, const char* value)
  324. {
  325. m_Definitions.insert(DefinitionMap::value_type(name, value));
  326. }
  327. void cmMakefile::SetProjectName(const char* p)
  328. {
  329. m_ProjectName = p;
  330. }
  331. void cmMakefile::AddLibrary(const char* lname, const std::vector<std::string> &srcs)
  332. {
  333. cmTarget target;
  334. target.m_IsALibrary = 1;
  335. target.m_SourceLists = srcs;
  336. m_Targets.insert(cmTargets::value_type(lname,target));
  337. }
  338. void cmMakefile::AddExecutable(const char *exeName,
  339. const std::vector<std::string> &srcs)
  340. {
  341. cmTarget target;
  342. target.m_IsALibrary = 0;
  343. target.m_SourceLists = srcs;
  344. m_Targets.insert(cmTargets::value_type(exeName,target));
  345. }
  346. void cmMakefile::AddSourceGroup(const char* name, const char* regex)
  347. {
  348. // First see if the group exists. If so, replace its regular expression.
  349. for(std::vector<cmSourceGroup>::iterator sg = m_SourceGroups.begin();
  350. sg != m_SourceGroups.end(); ++sg)
  351. {
  352. std::string sgName = sg->GetName();
  353. if(sgName == name)
  354. {
  355. // We only want to set the regular expression. If there are already
  356. // source files in the group, we don't want to remove them.
  357. sg->SetGroupRegex(regex);
  358. return;
  359. }
  360. }
  361. // The group doesn't exist. Add it.
  362. m_SourceGroups.push_back(cmSourceGroup(name, regex));
  363. }
  364. void cmMakefile::AddExtraDirectory(const char* dir)
  365. {
  366. m_AuxSourceDirectories.push_back(dir);
  367. }
  368. // return the file name for the parent CMakeLists file to the
  369. // one passed in. Zero is returned if the CMakeLists file is the
  370. // one in the home directory or if for some reason a parent cmake lists
  371. // file cannot be found.
  372. std::string cmMakefile::GetParentListFileName(const char *currentFileName)
  373. {
  374. // extract the directory name
  375. std::string parentFile;
  376. std::string listsDir = currentFileName;
  377. std::string::size_type pos = listsDir.rfind('/');
  378. // if we could not find the directory return 0
  379. if(pos == std::string::npos)
  380. {
  381. return parentFile;
  382. }
  383. listsDir = listsDir.substr(0, pos);
  384. // if we are in the home directory then stop, return 0
  385. if(m_cmHomeDirectory == listsDir)
  386. {
  387. return parentFile;
  388. }
  389. // is there a parent directory we can check
  390. pos = listsDir.rfind('/');
  391. // if we could not find the directory return 0
  392. if(pos == std::string::npos)
  393. {
  394. return parentFile;
  395. }
  396. listsDir = listsDir.substr(0, pos);
  397. // is there a CMakeLists.txt file in the parent directory ?
  398. parentFile = listsDir;
  399. parentFile += "/CMakeLists.txt";
  400. if(!cmSystemTools::FileExists(parentFile.c_str()))
  401. {
  402. parentFile = "";
  403. return parentFile;
  404. }
  405. return parentFile;
  406. }
  407. // expance CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR in the
  408. // include and library directories.
  409. void cmMakefile::ExpandVariables()
  410. {
  411. // Now expand varibles in the include and link strings
  412. std::vector<std::string>::iterator j, begin, end;
  413. begin = m_IncludeDirectories.begin();
  414. end = m_IncludeDirectories.end();
  415. for(j = begin; j != end; ++j)
  416. {
  417. this->ExpandVariablesInString(*j);
  418. }
  419. begin = m_LinkDirectories.begin();
  420. end = m_LinkDirectories.end();
  421. for(j = begin; j != end; ++j)
  422. {
  423. this->ExpandVariablesInString(*j);
  424. }
  425. begin = m_LinkLibraries.begin();
  426. end = m_LinkLibraries.end();
  427. for(j = begin; j != end; ++j)
  428. {
  429. this->ExpandVariablesInString(*j);
  430. }
  431. }
  432. const char* cmMakefile::GetDefinition(const char* name)
  433. {
  434. DefinitionMap::iterator pos = m_Definitions.find(name);
  435. if(pos != m_Definitions.end())
  436. {
  437. return (*pos).second.c_str();
  438. }
  439. return 0;
  440. }
  441. int cmMakefile::DumpDocumentationToFile(const char *fileName)
  442. {
  443. // Open the supplied filename
  444. std::ofstream f;
  445. f.open(fileName, std::ios::out);
  446. if ( f.fail() )
  447. {
  448. return 0;
  449. }
  450. // Loop over all registered commands and print out documentation
  451. const char *name;
  452. const char *terse;
  453. const char *full;
  454. for(RegisteredCommandsMap::iterator j = m_Commands.begin();
  455. j != m_Commands.end(); ++j)
  456. {
  457. name = (*j).second->GetName();
  458. terse = (*j).second->GetTerseDocumentation();
  459. full = (*j).second->GetFullDocumentation();
  460. f << name << " - " << terse << std::endl
  461. << "Usage: " << full << std::endl << std::endl;
  462. }
  463. return 1;
  464. }
  465. void cmMakefile::ExpandVariablesInString(std::string& source) const
  466. {
  467. for(DefinitionMap::const_iterator i = m_Definitions.begin();
  468. i != m_Definitions.end(); ++i)
  469. {
  470. std::string variable = "${";
  471. variable += (*i).first;
  472. variable += "}";
  473. cmSystemTools::ReplaceString(source, variable.c_str(),
  474. (*i).second.c_str());
  475. variable = "@";
  476. variable += (*i).first;
  477. variable += "@";
  478. cmSystemTools::ReplaceString(source, variable.c_str(),
  479. (*i).second.c_str());
  480. }
  481. }
  482. // recursive function to create a vector of cmMakefile objects
  483. // This is done by reading the sub directory CMakeLists.txt files,
  484. // then calling this function with the new cmMakefile object
  485. void
  486. cmMakefile::FindSubDirectoryCMakeListsFiles(std::vector<cmMakefile*>&
  487. makefiles)
  488. {
  489. // loop over all the sub directories of this makefile
  490. const std::vector<std::string>& subdirs = this->GetSubDirectories();
  491. for(std::vector<std::string>::const_iterator i = subdirs.begin();
  492. i != subdirs.end(); ++i)
  493. {
  494. std::string subdir = *i;
  495. // Create a path to the list file in the sub directory
  496. std::string listFile = this->GetCurrentDirectory();
  497. listFile += "/";
  498. listFile += subdir;
  499. listFile += "/CMakeLists.txt";
  500. // if there is a CMakeLists.txt file read it
  501. if(!cmSystemTools::FileExists(listFile.c_str()))
  502. {
  503. cmSystemTools::Error("CMakeLists.txt file missing from sub directory:",
  504. listFile.c_str());
  505. }
  506. else
  507. {
  508. cmMakefile* mf = new cmMakefile;
  509. makefiles.push_back(mf);
  510. // initialize new makefile
  511. mf->SetHomeOutputDirectory(this->GetHomeOutputDirectory());
  512. mf->SetHomeDirectory(this->GetHomeDirectory());
  513. // add the subdir to the start output directory
  514. std::string outdir = this->GetStartOutputDirectory();
  515. outdir += "/";
  516. outdir += subdir;
  517. mf->SetStartOutputDirectory(outdir.c_str());
  518. // add the subdir to the start source directory
  519. std::string currentDir = this->GetStartDirectory();
  520. currentDir += "/";
  521. currentDir += subdir;
  522. mf->SetStartDirectory(currentDir.c_str());
  523. // Parse the CMakeLists.txt file
  524. currentDir += "/CMakeLists.txt";
  525. mf->MakeStartDirectoriesCurrent();
  526. mf->ReadListFile(currentDir.c_str());
  527. // recurse into nextDir
  528. mf->FindSubDirectoryCMakeListsFiles(makefiles);
  529. }
  530. }
  531. }
  532. void cmMakefile::GenerateCacheOnly()
  533. {
  534. std::vector<cmMakefile*> makefiles;
  535. this->FindSubDirectoryCMakeListsFiles(makefiles);
  536. for(unsigned int i =0; i < makefiles.size(); ++i)
  537. {
  538. delete makefiles[i];
  539. }
  540. }
  541. /**
  542. * Add the default definitions to the makefile. These values must not
  543. * be dependent on anything that isn't known when this cmMakefile instance
  544. * is constructed.
  545. */
  546. void cmMakefile::AddDefaultDefinitions()
  547. {
  548. #if defined(_WIN32) && !defined(__CYGWIN__)
  549. this->AddDefinition("CMAKE_CFG_OUTDIR","$(OUTDIR)");
  550. #else
  551. this->AddDefinition("CMAKE_CFG_OUTDIR",".");
  552. #endif
  553. }
  554. /**
  555. * Find a source group whose regular expression matches the filename
  556. * part of the given source name. Search backward through the list of
  557. * source groups, and take the first matching group found. This way
  558. * non-inherited SOURCE_GROUP commands will have precedence over
  559. * inherited ones.
  560. */
  561. cmSourceGroup&
  562. cmMakefile::FindSourceGroup(const char* source,
  563. std::vector<cmSourceGroup> &groups)
  564. {
  565. std::string file = source;
  566. std::string::size_type pos = file.rfind('/');
  567. if(pos != std::string::npos)
  568. {
  569. file = file.substr(pos, file.length()-pos);
  570. }
  571. for(std::vector<cmSourceGroup>::reverse_iterator sg = groups.rbegin();
  572. sg != groups.rend(); ++sg)
  573. {
  574. if(sg->Matches(file.c_str()))
  575. {
  576. return *sg;
  577. }
  578. }
  579. // Shouldn't get here, but just in case, return the default group.
  580. return groups.front();
  581. }
  582. // take srclists and put all the classes into a vector
  583. std::vector<cmClassFile>
  584. cmMakefile::GetClassesFromSourceLists(
  585. const std::vector<std::string> &srcLists)
  586. {
  587. std::vector<cmClassFile> result;
  588. // for each src lists add the classes
  589. for (std::vector<std::string>::const_iterator s = srcLists.begin();
  590. s != srcLists.end(); ++s)
  591. {
  592. // replace any variables
  593. std::string temps = *s;
  594. this->ExpandVariablesInString(temps);
  595. // look for a srclist
  596. if (m_Classes.find(temps) != m_Classes.end())
  597. {
  598. const std::vector<cmClassFile> &clsList =
  599. m_Classes.find(temps)->second;
  600. result.insert(result.end(), clsList.begin(), clsList.end());
  601. }
  602. // if one wasn't found then assume it is a single class
  603. else
  604. {
  605. cmClassFile file;
  606. file.m_AbstractClass = false;
  607. file.SetName(temps.c_str(), this->GetCurrentDirectory());
  608. result.push_back(file);
  609. }
  610. }
  611. return result;
  612. }