cmMakefile.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmMakefile_h
  14. #define cmMakefile_h
  15. #include "cmData.h"
  16. #include "cmSystemTools.h"
  17. #include "cmSourceGroup.h"
  18. #include "cmTarget.h"
  19. #include "cmListFileCache.h"
  20. #include "cmCacheManager.h"
  21. class cmFunctionBlocker;
  22. class cmCommand;
  23. class cmLocalGenerator;
  24. class cmMakeDepend;
  25. class cmSourceFile;
  26. class cmVariableWatch;
  27. class cmake;
  28. /** \class cmMakefile
  29. * \brief Process the input CMakeLists.txt file.
  30. *
  31. * Process and store into memory the input CMakeLists.txt file.
  32. * Each CMakeLists.txt file is parsed and the commands found there
  33. * are added into the build process.
  34. */
  35. class cmMakefile
  36. {
  37. public:
  38. /**
  39. * Return major and minor version numbers for cmake.
  40. */
  41. static unsigned int GetMajorVersion() { return CMake_VERSION_MAJOR; }
  42. static unsigned int GetMinorVersion() { return CMake_VERSION_MINOR; }
  43. static const char* GetReleaseVersion();
  44. /**
  45. * Return the major and minor version of the cmake that
  46. * was used to write the currently loaded cache, note
  47. * this method will not work before the cache is loaded.
  48. */
  49. unsigned int GetCacheMajorVersion();
  50. unsigned int GetCacheMinorVersion();
  51. /**
  52. * Construct an empty makefile.
  53. */
  54. cmMakefile();
  55. /**
  56. * Destructor.
  57. */
  58. ~cmMakefile();
  59. /**
  60. * Read and parse a CMakeLists.txt file.
  61. */
  62. bool ReadListFile(const char* listfile, const char* external= 0);
  63. /**
  64. * Add a function blocker to this makefile
  65. */
  66. void AddFunctionBlocker(cmFunctionBlocker *fb)
  67. { m_FunctionBlockers.push_back(fb);}
  68. void RemoveFunctionBlocker(cmFunctionBlocker *fb)
  69. { m_FunctionBlockers.remove(fb);}
  70. void RemoveFunctionBlocker(const cmListFileFunction& lff);
  71. /**
  72. * Try running cmake and building a file. This is used for dynalically
  73. * loaded commands, not as part of the usual build process.
  74. */
  75. int TryCompile(const char *srcdir, const char *bindir,
  76. const char *projectName, const char *targetName,
  77. const std::vector<std::string> *cmakeArgs,
  78. std::string *output);
  79. /**
  80. * Specify the makefile generator. This is platform/compiler
  81. * dependent, although the interface is through a generic
  82. * superclass.
  83. */
  84. void SetLocalGenerator(cmLocalGenerator*);
  85. ///! Get the current makefile generator.
  86. cmLocalGenerator* GetLocalGenerator()
  87. { return m_LocalGenerator;}
  88. /**
  89. * Perform FinalPass, Library dependency analysis etc before output of the
  90. * makefile.
  91. */
  92. void ConfigureFinalPass();
  93. /**
  94. * run the final pass on all commands.
  95. */
  96. void FinalPass();
  97. /**
  98. * Print the object state to std::cout.
  99. */
  100. void Print() const;
  101. /**
  102. * Add a custom command to the build.
  103. */
  104. void AddCustomCommandToOutput(const char* output,
  105. const char* command,
  106. const std::vector<std::string>& commandArgs,
  107. const char *main_dependency,
  108. const std::vector<std::string>& depends,
  109. const char *comment = 0,
  110. bool replace = false);
  111. void AddCustomCommandToTarget(const char* target,
  112. const char* command,
  113. const std::vector<std::string>& commandArgs,
  114. cmTarget::CustomCommandType type,
  115. const char *comment = 0);
  116. void AddCustomCommandToTarget(const char* target,
  117. const char* command,
  118. const std::vector<std::string>& commandArgs,
  119. cmTarget::CustomCommandType type,
  120. const char *comment,
  121. const std::vector<std::string>& depends);
  122. /**
  123. * Add a custom command to the build.
  124. */
  125. void AddCustomCommand(const char* source,
  126. const char* command,
  127. const std::vector<std::string>& commandArgs,
  128. const std::vector<std::string>& depends,
  129. const std::vector<std::string>& outputs,
  130. const char *target,
  131. const char *comment = 0);
  132. void AddCustomCommand(const char* source,
  133. const char* command,
  134. const std::vector<std::string>& commandArgs,
  135. const std::vector<std::string>& depends,
  136. const char* output,
  137. const char* target);
  138. /**
  139. * Add a define flag to the build.
  140. */
  141. void AddDefineFlag(const char* definition);
  142. /**
  143. * Add an executable to the build.
  144. */
  145. cmTarget* AddExecutable(const char *exename,
  146. const std::vector<std::string> &srcs);
  147. /**
  148. * Add a utility to the build. A utiltity target is
  149. * a command that is run every time a target is built.
  150. */
  151. void AddUtilityCommand(const char* utilityName,
  152. const char* command,
  153. const char* arguments,
  154. bool all,
  155. const std::vector<std::string> &depends);
  156. void AddUtilityCommand(const char* utilityName,
  157. const char* command,
  158. const char* arguments,
  159. bool all,
  160. const std::vector<std::string> &depends,
  161. const std::vector<std::string> &outputs);
  162. /**
  163. * Add a link library to the build.
  164. */
  165. void AddLinkLibrary(const char*);
  166. void AddLinkLibrary(const char*, cmTarget::LinkLibraryType type);
  167. void AddLinkLibraryForTarget(const char *tgt, const char*,
  168. cmTarget::LinkLibraryType type);
  169. void AddLinkDirectoryForTarget(const char *tgt, const char* d);
  170. /**
  171. * Add a link directory to the build.
  172. */
  173. void AddLinkDirectory(const char*);
  174. /**
  175. * Add a subdirectory to the build.
  176. */
  177. void AddSubDirectory(const char*);
  178. /**
  179. * Add an include directory to the build.
  180. */
  181. void AddIncludeDirectory(const char*, bool before = false);
  182. /**
  183. * Find a library (as in cmSystemTools) but add in compiler specific paths
  184. */
  185. std::string FindLibrary(const char* name,
  186. const std::vector<std::string>& path);
  187. /**
  188. * Add a variable definition to the build. This variable
  189. * can be used in CMake to refer to lists, directories, etc.
  190. */
  191. void AddDefinition(const char* name, const char* value);
  192. ///! Add a definition to this makefile and the global cmake cache.
  193. void AddCacheDefinition(const char* name, const char* value,
  194. const char* doc,
  195. cmCacheManager::CacheEntryType type);
  196. /**
  197. * Add bool variable definition to the build.
  198. */
  199. void AddDefinition(const char* name, bool);
  200. ///! Add a definition to this makefile and the global cmake cache.
  201. void AddCacheDefinition(const char* name, bool, const char* doc);
  202. /**
  203. * Remove a variable definition from the build. This is not valid
  204. * for cache entries, and will only affect the current makefile.
  205. */
  206. void RemoveDefinition(const char* name);
  207. /**
  208. * Specify the name of the project for this build.
  209. */
  210. void SetProjectName(const char*);
  211. /**
  212. * Get the name of the project for this build.
  213. */
  214. const char* GetProjectName()
  215. {
  216. return m_ProjectName.c_str();
  217. }
  218. std::vector<std::string> const& GetParentProjects()
  219. {
  220. return m_ParentProjects;
  221. }
  222. /**
  223. * Set the name of the library.
  224. */
  225. void AddLibrary(const char *libname, int shared,
  226. const std::vector<std::string> &srcs);
  227. /**
  228. * Add a class/source file to the build.
  229. */
  230. //void AddSource(cmSourceFile& ,const char *srcListName);
  231. /**
  232. * Remove a class/source file from the build.
  233. */
  234. //void RemoveSource(cmSourceFile& ,const char *srcListName);
  235. /**
  236. * Add a source group for consideration when adding a new source.
  237. */
  238. void AddSourceGroup(const char* name, const char* regex=0);
  239. /**
  240. * Add an auxiliary directory to the build.
  241. */
  242. void AddExtraDirectory(const char* dir);
  243. /**
  244. * Add an auxiliary directory to the build.
  245. */
  246. void MakeStartDirectoriesCurrent()
  247. {
  248. m_cmCurrentDirectory = m_cmStartDirectory;
  249. m_CurrentOutputDirectory = m_StartOutputDirectory;
  250. this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", m_cmCurrentDirectory.c_str());
  251. this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", m_CurrentOutputDirectory.c_str());
  252. }
  253. //@{
  254. /**
  255. * Set/Get the home directory (or output directory) in the project. The
  256. * home directory is the top directory of the project. It is where
  257. * CMakeSetup or configure was run. Remember that CMake processes
  258. * CMakeLists files by recursing up the tree starting at the StartDirectory
  259. * and going up until it reaches the HomeDirectory.
  260. */
  261. void SetHomeDirectory(const char* dir);
  262. const char* GetHomeDirectory() const
  263. {
  264. return m_cmHomeDirectory.c_str();
  265. }
  266. void SetHomeOutputDirectory(const char* lib);
  267. const char* GetHomeOutputDirectory() const
  268. {
  269. return m_HomeOutputDirectory.c_str();
  270. }
  271. //@}
  272. //@{
  273. /**
  274. * Set/Get the start directory (or output directory). The start directory
  275. * is the directory of the CMakeLists.txt file that started the current
  276. * round of processing. Remember that CMake processes CMakeLists files by
  277. * recursing up the tree starting at the StartDirectory and going up until
  278. * it reaches the HomeDirectory.
  279. */
  280. void SetStartDirectory(const char* dir)
  281. {
  282. m_cmStartDirectory = dir;
  283. cmSystemTools::ConvertToUnixSlashes(m_cmStartDirectory);
  284. }
  285. const char* GetStartDirectory() const
  286. {
  287. return m_cmStartDirectory.c_str();
  288. }
  289. void SetStartOutputDirectory(const char* lib)
  290. {
  291. m_StartOutputDirectory = lib;
  292. cmSystemTools::ConvertToUnixSlashes(m_StartOutputDirectory);
  293. cmSystemTools::MakeDirectory(m_StartOutputDirectory.c_str());
  294. }
  295. const char* GetStartOutputDirectory() const
  296. {
  297. return m_StartOutputDirectory.c_str();
  298. }
  299. //@}
  300. //@{
  301. /**
  302. * Set/Get the current directory (or output directory) in the project. The
  303. * current directory is the directory of the CMakeLists.txt file that is
  304. * currently being processed. Remember that CMake processes CMakeLists
  305. * files by recursing up the tree starting at the StartDirectory and going
  306. * up until it reaches the HomeDirectory.
  307. */
  308. void SetCurrentDirectory(const char* dir)
  309. {
  310. m_cmCurrentDirectory = dir;
  311. cmSystemTools::ConvertToUnixSlashes(m_cmCurrentDirectory);
  312. this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", m_cmCurrentDirectory.c_str());
  313. }
  314. const char* GetCurrentDirectory() const
  315. {
  316. return m_cmCurrentDirectory.c_str();
  317. }
  318. void SetCurrentOutputDirectory(const char* lib)
  319. {
  320. m_CurrentOutputDirectory = lib;
  321. cmSystemTools::ConvertToUnixSlashes(m_CurrentOutputDirectory);
  322. this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", m_CurrentOutputDirectory.c_str());
  323. }
  324. const char* GetCurrentOutputDirectory() const
  325. {
  326. return m_CurrentOutputDirectory.c_str();
  327. }
  328. /* Get the current CMakeLists.txt file that is being processed. This
  329. * is just used in order to be able to 'branch' from one file to a second
  330. * transparently */
  331. const char* GetCurrentListFile() const
  332. {
  333. return m_cmCurrentListFile.c_str();
  334. }
  335. //@}
  336. /**
  337. * Set a regular expression that include files must match
  338. * in order to be considered as part of the depend information.
  339. */
  340. void SetIncludeRegularExpression(const char* regex)
  341. {
  342. m_IncludeFileRegularExpression = regex;
  343. }
  344. /**
  345. * Set a regular expression that include files that are not found
  346. * must match in order to be considered a problem.
  347. */
  348. void SetComplainRegularExpression(const char* regex)
  349. {
  350. m_ComplainFileRegularExpression = regex;
  351. }
  352. /**
  353. * Get the list of targets
  354. */
  355. cmTargets &GetTargets() { return m_Targets; }
  356. const cmTargets &GetTargets() const { return m_Targets; }
  357. /**
  358. * Get a list of the build subdirectories.
  359. */
  360. const std::vector<std::string>& GetSubDirectories()
  361. {
  362. return m_SubDirectories;
  363. }
  364. /**
  365. * Get a list of include directories in the build.
  366. */
  367. std::vector<std::string>& GetIncludeDirectories()
  368. {
  369. return m_IncludeDirectories;
  370. }
  371. const std::vector<std::string>& GetIncludeDirectories() const
  372. {
  373. return m_IncludeDirectories;
  374. }
  375. /** Expand out any arguements in the vector that have ; separated
  376. * strings into multiple arguements. A new vector is created
  377. * containing the expanded versions of all arguments in argsIn.
  378. * This method differes from the one in cmSystemTools in that if
  379. * the CmakeLists file is version 1.2 or earlier it will check for
  380. * source lists being used without ${} around them
  381. */
  382. void ExpandSourceListArguments(std::vector<std::string> const& argsIn,
  383. std::vector<std::string>& argsOut,
  384. unsigned int startArgumentIndex);
  385. /** Get a cmSourceFile pointer for a given source name, if the name is
  386. * not found, then a null pointer is returned.
  387. */
  388. cmSourceFile* GetSource(const char* sourceName) const;
  389. ///! Add a new cmSourceFile to the list of sources for this makefile.
  390. cmSourceFile* AddSource(cmSourceFile const&);
  391. /** Get a cmSourceFile pointer for a given source name, if the name is
  392. * not found, then create the source file and return it. generated
  393. * indicates if it is a generated file, this is used in determining
  394. * how to create the source file instance e.g. name
  395. */
  396. cmSourceFile* GetOrCreateSource(const char* sourceName,
  397. bool generated = false);
  398. /**
  399. * Obtain a list of auxiliary source directories.
  400. */
  401. std::vector<std::string>& GetAuxSourceDirectories()
  402. {return m_AuxSourceDirectories;}
  403. //@{
  404. /**
  405. * Return a list of extensions associated with source and header
  406. * files
  407. */
  408. const std::vector<std::string>& GetSourceExtensions() const
  409. {return m_SourceFileExtensions;}
  410. const std::vector<std::string>& GetHeaderExtensions() const
  411. {return m_HeaderFileExtensions;}
  412. //@}
  413. /**
  414. * Given a variable name, return its value (as a string).
  415. * If the variable is not found in this makefile instance, the
  416. * cache is then queried.
  417. */
  418. const char* GetDefinition(const char*) const;
  419. /**
  420. * Get the list of all variables in the current space. If argument
  421. * cacheonly is specified and is greater than 0, then only cache
  422. * variables will be listed.
  423. */
  424. std::vector<std::string> GetDefinitions(int cacheonly=0) const;
  425. /** Test a boolean cache entry to see if it is true or false,
  426. * returns false if no entry defined.
  427. */
  428. bool IsOn(const char* name) const;
  429. /**
  430. * Get a list of preprocessor define flags.
  431. */
  432. const char* GetDefineFlags()
  433. {return m_DefineFlags.c_str();}
  434. /**
  435. * Get the vector of used command instances.
  436. */
  437. const std::vector<cmCommand*>& GetUsedCommands() const
  438. {return m_UsedCommands;}
  439. /**
  440. * Get the vector source groups.
  441. */
  442. const std::vector<cmSourceGroup>& GetSourceGroups() const
  443. { return m_SourceGroups; }
  444. /**
  445. * Get the source group
  446. */
  447. cmSourceGroup* GetSourceGroup(const char* name);
  448. /**
  449. * Get the vector of list files on which this makefile depends
  450. */
  451. const std::vector<std::string>& GetListFiles() const
  452. { return m_ListFiles; }
  453. ///! When the file changes cmake will be re-run from the build system.
  454. void AddCMakeDependFile(const char* file)
  455. { m_ListFiles.push_back(file);}
  456. /**
  457. * Expand all defined variables in the string.
  458. * Defined variables come from the m_Definitions map.
  459. * They are expanded with ${var} where var is the
  460. * entry in the m_Definitions map. Also @var@ is
  461. * expanded to match autoconf style expansions.
  462. */
  463. const char *ExpandVariablesInString(std::string& source) const;
  464. const char *ExpandVariablesInString(std::string& source, bool escapeQuotes,
  465. bool atOnly = false) const;
  466. /**
  467. * Remove any remaining variables in the string. Anything with ${var} or
  468. * @var@ will be removed.
  469. */
  470. void RemoveVariablesInString(std::string& source, bool atOnly = false) const;
  471. /**
  472. * Expand variables in the makefiles ivars such as link directories etc
  473. */
  474. void ExpandVariables();
  475. void ExpandVariablesInCustomCommands();
  476. /**
  477. * find what source group this source is in
  478. */
  479. cmSourceGroup& FindSourceGroup(const char* source,
  480. std::vector<cmSourceGroup> &groups);
  481. void RegisterData(cmData*);
  482. void RegisterData(const char*, cmData*);
  483. cmData* LookupData(const char*) const;
  484. /**
  485. * Execute a single CMake command. Returns true if the command
  486. * succeeded or false if it failed.
  487. */
  488. bool ExecuteCommand(const cmListFileFunction& lff);
  489. /** Check if a command exists. */
  490. bool CommandExists(const char* name) const;
  491. /**
  492. * Add a command to this cmake instance
  493. */
  494. void AddCommand(cmCommand* );
  495. ///! Enable support for the named language, if null then all languages are enabled.
  496. void EnableLanguage(const char* );
  497. /**
  498. * Set/Get the name of the parent directories CMakeLists file
  499. * given a current CMakeLists file name
  500. */
  501. cmCacheManager *GetCacheManager() const;
  502. cmVariableWatch* GetVariableWatch() const;
  503. //! Determine wether this is a local or global build.
  504. bool GetLocal() const;
  505. ///! Display progress or status message.
  506. void DisplayStatus(const char*, float);
  507. /**
  508. * Expand the given list file arguments into the full set after
  509. * variable replacement and list expansion.
  510. */
  511. void ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
  512. std::vector<std::string>& outArgs);
  513. /**
  514. * Get the instance
  515. */
  516. cmake *GetCMakeInstance() const;
  517. /**
  518. * Get all the source files this makefile knows about
  519. */
  520. const std::vector<cmSourceFile*> &GetSourceFiles() const
  521. {return m_SourceFiles;}
  522. std::vector<cmSourceFile*> &GetSourceFiles() {return m_SourceFiles;}
  523. /**
  524. * Is there a source file that has the provided source file as an output?
  525. * if so then return it
  526. */
  527. cmSourceFile *GetSourceFileWithOutput(const char *outName);
  528. /**
  529. * Add a macro to the list of macros. The arguments should be name of the
  530. * macro and a documentation signature of it
  531. */
  532. void AddMacro(const char* name, const char* signature);
  533. /**
  534. * Get a list of macros as a ; separated string
  535. */
  536. void GetListOfMacros(std::string& macros);
  537. /**
  538. * Return a location of a file in cmake or custom modules directory
  539. */
  540. std::string GetModulesFile(const char* name);
  541. protected:
  542. // add link libraries and directories to the target
  543. void AddGlobalLinkInformation(const char* name, cmTarget& target);
  544. std::string m_Prefix;
  545. std::vector<std::string> m_AuxSourceDirectories; //
  546. std::string m_cmCurrentDirectory;
  547. std::string m_CurrentOutputDirectory;
  548. std::string m_cmStartDirectory;
  549. std::string m_StartOutputDirectory;
  550. std::string m_cmHomeDirectory;
  551. std::string m_HomeOutputDirectory;
  552. std::string m_cmCurrentListFile;
  553. std::string m_ProjectName; // project name
  554. std::vector<std::string> m_ParentProjects;
  555. // libraries, classes, and executables
  556. cmTargets m_Targets;
  557. std::vector<cmSourceFile*> m_SourceFiles;
  558. std::vector<std::string> m_SubDirectories; // list of sub directories
  559. struct StringSet : public std::set<cmStdString>
  560. {
  561. };
  562. // The include and link-library paths. These may have order
  563. // dependency, so they must be vectors (not set).
  564. std::vector<std::string> m_IncludeDirectories;
  565. std::vector<std::string> m_LinkDirectories;
  566. std::vector<std::string> m_ListFiles; // list of command files loaded
  567. cmTarget::LinkLibraries m_LinkLibraries;
  568. std::string m_IncludeFileRegularExpression;
  569. std::string m_ComplainFileRegularExpression;
  570. std::vector<std::string> m_SourceFileExtensions;
  571. std::vector<std::string> m_HeaderFileExtensions;
  572. std::string m_DefineFlags;
  573. std::vector<cmSourceGroup> m_SourceGroups;
  574. typedef std::map<cmStdString, cmStdString> DefinitionMap;
  575. DefinitionMap m_Definitions;
  576. std::vector<cmCommand*> m_UsedCommands;
  577. cmLocalGenerator* m_LocalGenerator;
  578. bool IsFunctionBlocked(const cmListFileFunction& lff);
  579. private:
  580. /**
  581. * Get the name of the parent directories CMakeLists file
  582. * given a current CMakeLists file name
  583. */
  584. std::string GetParentListFileName(const char *listFileName);
  585. void ReadSources(std::ifstream& fin, bool t);
  586. friend class cmMakeDepend; // make depend needs direct access
  587. // to the m_Sources array
  588. void PrintStringVector(const char* s, const std::vector<std::string>& v) const;
  589. void AddDefaultDefinitions();
  590. std::list<cmFunctionBlocker *> m_FunctionBlockers;
  591. typedef std::map<cmStdString, cmData*> DataMap;
  592. DataMap m_DataMap;
  593. bool m_Inheriting;
  594. typedef std::map<cmStdString, cmStdString> StringStringMap;
  595. StringStringMap m_MacrosMap;
  596. // used in AddDefinition for performance improvement
  597. DefinitionMap::key_type m_TemporaryDefinitionKey;
  598. };
  599. #endif