cmGlobalUnixMakefileGenerator3.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator3
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2005 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 cmGlobalUnixMakefileGenerator3_h
  14. #define cmGlobalUnixMakefileGenerator3_h
  15. #include "cmGlobalGenerator.h"
  16. class cmGeneratedFileStream;
  17. class cmLocalUnixMakefileGenerator3;
  18. /** \class cmGlobalUnixMakefileGenerator3
  19. * \brief Write a Unix makefiles.
  20. *
  21. * cmGlobalUnixMakefileGenerator3 manages UNIX build process for a tree
  22. */
  23. class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator
  24. {
  25. public:
  26. cmGlobalUnixMakefileGenerator3();
  27. static cmGlobalGenerator* New() { return new cmGlobalUnixMakefileGenerator3; }
  28. ///! Get the name for the generator.
  29. virtual const char* GetName() const {
  30. return cmGlobalUnixMakefileGenerator3::GetActualName();}
  31. static const char* GetActualName() {return "Unix Makefiles 3";}
  32. /** Get the documentation entry for this generator. */
  33. virtual void GetDocumentation(cmDocumentationEntry& entry) const;
  34. ///! Create a local generator appropriate to this Global Generator3
  35. virtual cmLocalGenerator *CreateLocalGenerator();
  36. /**
  37. * Try to determine system infomation such as shared library
  38. * extension, pthreads, byte order etc.
  39. */
  40. virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *);
  41. /**
  42. * Generate the all required files for building this project/tree. This
  43. * basically creates a series of LocalGenerators for each directory and
  44. * requests that they Generate.
  45. */
  46. virtual void Generate();
  47. protected:
  48. void WriteMainMakefile();
  49. void WriteMainCMakefile();
  50. void WriteDependMakefile();
  51. void WriteBuildMakefile();
  52. void WriteCleanMakefile();
  53. void WriteMainCMakefileLanguageRules(cmGeneratedFileStream& cmakefileStream);
  54. void WriteAllRules(cmLocalUnixMakefileGenerator3 *lg,
  55. std::ostream& makefileStream);
  56. /** used to create a recursive make call */
  57. std::string GetRecursiveMakeCall(const char *makefile, const char* tgt);
  58. void WriteConvenienceRules(std::ostream& ruleFileStream, cmLocalUnixMakefileGenerator3 *);
  59. };
  60. #endif