cmBorlandMakefileGenerator.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef cmBorlandMakefileGenerator_h
  2. #define cmBorlandMakefileGenerator_h
  3. #include "cmMakefile.h"
  4. #include "cmMakefileGenerator.h"
  5. /** \class cmBorlandMakefileGenerator
  6. * \brief Write Borland BCB5 compatible makefiles.
  7. *
  8. * cmBorlandMakefileGenerator produces Borland BCB5 compatible makefiles
  9. */
  10. class cmBorlandMakefileGenerator : public cmMakefileGenerator
  11. {
  12. public:
  13. ///! Set cache only and recurse to false by default.
  14. cmBorlandMakefileGenerator();
  15. ///! Get the name for the generator.
  16. virtual const char* GetName() {return "Borland Makefiles";}
  17. ///! virtual copy constructor
  18. virtual cmMakefileGenerator* CreateObject()
  19. { return new cmBorlandMakefileGenerator;}
  20. //! just sets the Cache Only and Recurse flags
  21. virtual void SetLocal(bool local);
  22. /**
  23. * If cache only is on.
  24. * Only stub makefiles are generated, and no depends, for speed.
  25. * The default is OFF.
  26. **/
  27. void SetCacheOnlyOn() {m_CacheOnly = true;}
  28. void SetCacheOnlyOff() {m_CacheOnly = false;}
  29. /**
  30. * If recurse is on, then all the makefiles below this one are parsed as well.
  31. */
  32. void SetRecurseOn() {m_Recurse = true;}
  33. void SetRecurseOff() {m_Recurse = false;}
  34. /**
  35. * Produce the makefile (in this case a Unix makefile).
  36. */
  37. virtual void GenerateMakefile();
  38. /**
  39. * Output the depend information for all the classes
  40. * in the makefile. These would have been generated
  41. * by the class cmMakeDepend.
  42. */
  43. void OutputObjectDepends(std::ostream&);
  44. /**
  45. * Try to determine system infomation such as shared library
  46. * extension, pthreads, byte order etc.
  47. */
  48. virtual void ComputeSystemInfo();
  49. private:
  50. void RecursiveGenerateCacheOnly();
  51. void GenerateCacheOnly();
  52. void OutputMakefile(const char* file);
  53. void OutputTargetRules(std::ostream& fout);
  54. void OutputTargets(std::ostream&);
  55. void OutputSubDirectoryRules(std::ostream&);
  56. void OutputDependInformation(std::ostream&);
  57. void OutputDependencies(std::ostream&);
  58. void OutputCustomRules(std::ostream&);
  59. void OutputMakeVariables(std::ostream&);
  60. void OutputMakeRules(std::ostream&);
  61. void OutputSubDirectoryVars(std::ostream& fout,
  62. const char* var,
  63. const char* target,
  64. const char* target1,
  65. const char* target2,
  66. const std::vector<std::string>& SubDirectories);
  67. void OutputMakeRule(std::ostream&,
  68. const char* comment,
  69. const char* target,
  70. const char* depends,
  71. const char* command);
  72. std::string EscapeSpaces(const char* str);
  73. private:
  74. bool m_CacheOnly;
  75. bool m_Recurse;
  76. std::string m_ExecutableOutputPath;
  77. std::string m_LibraryOutputPath;
  78. };
  79. #endif