summaryrefslogtreecommitdiffstats
path: root/Source/cmBorlandMakefileGenerator.h
blob: 5ba6452a9ffc197fb4ef36c7f157cd2ec4da0fd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef cmBorlandMakefileGenerator_h
#define cmBorlandMakefileGenerator_h

#include "cmMakefile.h"
#include "cmMakefileGenerator.h"

/** \class cmBorlandMakefileGenerator
 * \brief Write a Unix makefiles.
 *
 * cmBorlandMakefileGenerator produces a Unix makefile from its
 * member m_Makefile.
 */
class cmBorlandMakefileGenerator : public cmMakefileGenerator
{
public:
  ///! Set cache only and recurse to false by default.
  cmBorlandMakefileGenerator();
    
  ///! Get the name for the generator.
  virtual const char* GetName() {return "Borland Makefiles";}

  ///! virtual copy constructor
  virtual cmMakefileGenerator* CreateObject() 
    { return new cmBorlandMakefileGenerator;}

  //! just sets the Cache Only and Recurse flags
  virtual void SetLocal(bool local);

  /**
   * If cache only is on.
   * Only stub makefiles are generated, and no depends, for speed.
   * The default is OFF.
   **/
  void SetCacheOnlyOn()  {m_CacheOnly = true;}
  void SetCacheOnlyOff() {m_CacheOnly = false;}

  /**
   * If recurse is on, then all the makefiles below this one are parsed as well.
   */
  void SetRecurseOn()  {m_Recurse = true;}
  void SetRecurseOff() {m_Recurse = false;}

  /**
   * Produce the makefile (in this case a Unix makefile).
   */
  virtual void GenerateMakefile();

  /**
   * Output the depend information for all the classes
   * in the makefile.  These would have been generated
   * by the class cmMakeDepend.
   */
  void OutputObjectDepends(std::ostream&);

  /**
   * Try to determine system infomation such as shared library
   * extension, pthreads, byte order etc.
   */
  virtual void ComputeSystemInfo();

private:
  void RecursiveGenerateCacheOnly();
  void GenerateCacheOnly();
  void OutputMakefile(const char* file);
  void OutputTargetRules(std::ostream& fout);
  void OutputTargets(std::ostream&);
  void OutputSubDirectoryRules(std::ostream&);
  void OutputDependInformation(std::ostream&);
  void OutputDependencies(std::ostream&);
  void OutputCustomRules(std::ostream&);
  void OutputMakeVariables(std::ostream&);
  void OutputMakeRules(std::ostream&);
  void OutputSubDirectoryVars(std::ostream& fout,
                              const char* var,
                              const char* target,
                              const char* target1,
                              const char* target2,
                              const std::vector<std::string>& SubDirectories);
  void OutputMakeRule(std::ostream&,
                      const char* comment,
                      const char* target,
                      const char* depends,
                      const char* command);
private:
  bool m_CacheOnly;
  bool m_Recurse;
  std::string m_ExecutableOutputPath;
  std::string m_LibraryOutputPath;
};

#endif